Consider
Book – Author
relationship.
————-
class Book(models.Model):
authors=models.ManyToManyField(Author)
—————
>>> b = Book.objects.get(id=50)
>>>b.authors.all()
this provides the list of authors
>>>b.authors.filter(name=’Lee’)
>>>a=Author.objects.get(name=’Lee’)
>>>a.book_set.all()
Similar to Foreign key value.
