Django QuerySets are lazy. When is the database actually queried?
- A As soon as the QuerySet is defined
- B When the QuerySet is iterated, sliced with a step, or otherwise evaluated
- C Only when save() is called
- D At the end of the request
Answer
When the QuerySet is iterated, sliced with a step, or otherwise evaluated
Laziness allows filters to be chained without extra queries. Evaluation happens on iteration, len(), list(), bool() and similar operations.





