Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20513 closed Cleanup/optimization (fixed)

Queryset caching behaviour needs more documentation

Reported by: David Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords: queryset
Cc: Seddon, bmispelon@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The documentation for the caching behaviour of querysets is misleading. It implies that queryset results are always cached, but in actual fact the cache is only set if the entire queryset is evaluated - not when a section of the queryset is queried (such as a call to queryset[3]).

I will attach a patch documenting this behaviour shortly.

Attachments (1)

20513.diff (1.7 KB) - added by David 4 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by David

Attachment: 20513.diff added

comment:1 Changed 4 years ago by David

Cc: Seddon added
Has patch: set

comment:2 Changed 4 years ago by David

Easy pickings: set

comment:3 Changed 4 years ago by Baptiste Mispelon

Cc: bmispelon@… added
Triage Stage: UnreviewedAccepted

This looks useful and the proposed patch looks pretty good (git apply complains about trailing whitespace on line 25 though).

I'm marking this as accepted.

I would mark it as ready for checkin too, but I feel this should get reviewed by a native speaker (which I'm not).

Thanks for your contribution.

comment:4 Changed 4 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

This looks good to me as well. I've wrapped the lines and made some minor edits.

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 8365d76da01af1d4391cba32d62178791d074b06:

Fixed #20513 - Expanded docs on QuerySet caching.

Thanks seddonym.

comment:6 Changed 4 years ago by Tim Graham <timograham@…>

In 2e026739dcab545703160456503a1183c6c0702d:

[1.5.X] Fixed #20513 - Expanded docs on QuerySet caching.

Thanks seddonym.

Backport of 8365d76da0 from master

Note: See TracTickets for help on using tickets.
Back to Top