Django Tutorials: Creating Relationships to Models Not yet Defined
from django.db import models class Car(models.Model): manufacturer = models.ForeignKey('Manufacturer') #instead of Manufacturer # ... class Manufacturer(models.Model): # ... pass
The name of the ForeignKey above is
manufacturer (left of the assignment operator). It is recommended that you use the name of the model in lowercase as the name of your
ForeignKey (though not required).