I have this in my models.py:
class AuditableTable(models.Model): class Meta: abstract = True created_by = models.ForeignKey(User,blank=True, related_name="%(app_label)s_%(class)s_related1") last_updated_by = models.ForeignKey(User,blank=True, related_name="%(app_label)s_%(class)s_related1") class Company(AuditableTable): pass
I believe that I am following the instructions associated with the abstract models mentioned here .
However, I get this error when running manage.py syncdb:
Error: One or more models did not validate: ItemLocator.company: Accessor for field 'created_by' clashes with related field 'User.itemlocator_company_related1'. Add a related_name argument to the definition for 'created_by'. ItemLocator.company: Reverse query name for field 'created_by' clashes with related field 'User.itemlocator_company_related1'. Add a related_name argument to the definition for 'created_by'. ItemLocator.company: Accessor for field 'last_updated_by' clashes with related field 'User.itemlocator_company_related1'. Add a related_name argument to the definition for 'last_updated_by'. ItemLocator.company: Reverse query name for field 'last_updated_by' clashes with related field 'User.itemlocator_company_related1'. Add a related_name argument to the definition for 'last_updated_by'.
I am on Django 1.2.
source share