Django

Code

Ticket #2565 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

Documentation should clarify lazy nature of querysets

Reported by: Simon Willison Assigned to: jacob
Milestone: Component: Documentation
Version: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

I've answered a couple of comments in the documentation recently about QuerySet? lazy evaluation:

http://www.djangoproject.com/documentation/tutorial4/#c2024 http://www.djangoproject.com/documentation/models/pagination/#c2032

That's enough for me to think that this is a frequent misunderstanding. We certainly don't want people to be put off Django because they think it makes horribly inefficient queries, when the exact opposite is true!

An entry in the FAQ would be a good start, but having notes (and a link) about this behaviour in the relevant places in the docs would be smart too.

Attachments

2565.diff (1.4 kB) - added by ubernostrum on 02/26/07 15:19:05.
Patch adding an explanation that all() doesn't query

Change History

08/19/06 09:44:51 changed by James Bennett <ubernostrum@gmail.com>

So a link from various places to this: http://www.djangoproject.com/documentation/db_api/#querysets-are-lazy might solve it?

02/13/07 15:24:01 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

Where should this be mentioned? possibly the best place would be to have a chained filter example in tutorial 1 and a comment/link to the db-api doc.

02/26/07 15:19:05 changed by ubernostrum

  • attachment 2565.diff added.

Patch adding an explanation that all() doesn't query

02/26/07 15:19:29 changed by ubernostrum

  • stage changed from Accepted to Ready for checkin.

02/26/07 22:27:48 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(In [4637]) Fixed #2565: added a note about the laziness of querysets in tutorial 4. Thanks, Ubernostrum.


Add/Change #2565 (Documentation should clarify lazy nature of querysets)




Change Properties
Action