# Now, given object e of type Entry, you would do e.blog to access
# the related object Blog - which is a forward relation.
class Blog(models.Model):
pass
class Entry(models.Model):
blog = Blog(..)
# The _set is a reverse lookup class variable django puts in for you.
# So, given object b - you would do:
entries = b.entry_set.all()
# Now, given object e of type Entry, you would do e.blog to access
# the related object Blog - which is a forward relation.
class Blog(models.Model):
pass
class Entry(models.Model):
blog = Blog(..)
# The _set is a reverse lookup class variable django puts in for you.
# So, given object b - you would do:
entries = b.entry_set.all()