[Django]-Django – models – how to describe a specific bidirectional relation between two models?

5👍

You can put the model class name as string, as

class Person(models.Model):
     department = models.ForeignKey('Department')
     ....

First few lines of django doc on foreignkey relationship explain this.

👤Rohan

Leave a comment