Here's a one-to-many relationship model
Class Cats (models. Model):
#...
Catnum = models. Integerfield (Unique=true)
#...
Class Items (models. Model):
CATID = models. ForeignKey (Cats, to_field= ' catnum ', db_column= ' catid ')
#...
Unhandled exception in thread started by
Traceback (most recent):
File "c:\python27\lib\site-packages\django\core\management\commands\runserver.py", line +, in Inner_run
Self.validate (Display_num_errors=true)
File "c:\python27\lib\site-packages\django\core\management\base.py", line 253, in validate
Raise CommandError ("one or more models do not validate:\n%s"% error_text)
Django.core.management.base.CommandError:One or more models do not validate:
Beauty.items:Reverse Query name for field ' CATID ' clashes with field ' Cats.items '. Add a related_name argument to the Definit
Ion for ' catid '.
The error that occurred probably meant to add a related_name parameter, so the items model was changed to
Class Items (models. Model):
CATID = models. ForeignKey (Cats, to_field= ' catnum ', db_column= ' catid ', related_name= ' catid ')
#...