Hi,

I try to call manage.py syncdb for my models, but I always get error
Lasttime, I solve the problem, by defining related_name for changedBy
attribute.
But now, I got the same problem after I define the model as abstract.

Error: One or more models did not validate:
person.person: Accessor for field 'changedBy' clashes with related field
'User._
changedBy'. Add a related_name argument to the definition for 'changedBy'.
person.person: Reverse query name for field 'changedBy' clashes with related
fie
ld 'User._changedBy'. Add a related_name argument to the definition for
'changed
By'.
film.film: Accessor for field 'changedBy' clashes with related field
'User._chan
gedBy'. Add a related_name argument to the definition for 'changedBy'.
film.film: Reverse query name for field 'changedBy' clashes with related
field '
User._changedBy'. Add a related_name argument to the definition for
'changedBy'.

Here is my model:
class AbstractContent(models.Model):
    viewed           = models.PositiveIntegerField(max_length=7, blank=True,
null=True)
    #rating           =
    #ranking          =
    created_by       = models.ForeignKey(User)
    changedBy        = models.ForeignKey(Use, related_name='_changedBy')
    created_at       = models.DateTimeField(auto_now_add=True)
    changed_at       = models.DateTimeField(auto_now=True, blank=True,
null=True)

    class Meta:
        abstract = True

class Person(AbstractContent):
    GENDER_TYPE = (
                      ('MALE','Male'),
                      ('FEMALE','Female')
                      )

    first_name = models.CharField(max_length=20)
    middle_name = models.CharField(max_length=20, blank=True)
    last_name = models.CharField(max_length=20)
    gender = models.CharField(max_length=6, choices=GENDER_TYPE)
    birth_date = models.DateField(blank=True)
    birth_country = models.CharField(max_length=20, blank=True)
    birth_city = models.CharField(max_length=20, blank=True)
    height = models.PositiveIntegerField(max_length=3, blank=True,
null=True)
    weight = models.PositiveIntegerField(max_length=3, blank=True,
null=True)
    def __unicode__(self):
        return self.last_name

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to