An in-depth guide to Django QuerySet (Django 3.0, updated June 2020).
Internally, a QuerySet can be constructed, filtered, sliced, and generally passed around without actually hitting the database. No database activity actually occurs until you do something to evaluate the queryset. Examples of that "something" that cause a QuerySet to evaluate:
- Iteration: QuerySet executes its database query the first time you iterate over it
for q in Quote.objects.all(): print(q.symbol)