set in django

Solutions on MaxInterview for set in django by the best coders in the world

showing results for - " set in django"
Lara
04 Jan 2019
1# Now, given object e of type Entry, you would do e.blog to access 
2# the related object Blog - which is a forward relation. 
3
4class Blog(models.Model):
5    pass
6
7class Entry(models.Model):
8    blog = Blog(..)
9
10# The _set is a reverse lookup class variable django puts in for you.    
11# So, given object b - you would do:
12entries = b.entry_set.all()