QuerySet API reference | Django documentation | Django

PHOTO EMBED

Wed Feb 16 2022 17:28:23 GMT+0000 (Coordinated Universal Time)

Saved by @arielvol

# Hits the database.
e = Entry.objects.select_related('blog').get(id=5)

# Doesn't hit the database, because e.blog has been prepopulated
# in the previous query.
b = e.blog
content_copyCOPY

https://docs.djangoproject.com/en/4.0/ref/models/querysets/