# core/models.py
from django.db import models
from django.contrib.auth.models import User
import ridgemoor.msg.models
from time import strftime
class Message(models.Model):
to = models.ForeignKey(User, related_name = "messages_received")
sender = models.ForeignKey(User, related_name = "messages_sent")
subject = models.CharField(max_length=50, blank=False)
sent = models.DateTimeField(auto_now_add=True)
recieved = models.DateTimeField(null=True)
body = models.TextField()
status = models.CharField(max_length=1, blank=True, null=True)
def __str__(self):
return self.subject
class Admin:
list_display = ('sent', 'to', 'sender', 'subject')
[EMAIL PROTECTED]:~/ridgemoor$ PYTHONPATH=$HOME ./manage.py syncdb
Error: One or more models did not validate:
core.message: Accessor for field 'to' clashes with related field
'User.messages_received'. Add a related_name argument to the definition for
'to'.
Something broke my app. it is most likely the changes I have been making to
get
things working under apache, but this may be a change to trunk.
It is telling me to add something that is already there.
Carl K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---