Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#20513 closed Cleanup/optimization (fixed)

Queryset caching behaviour needs more documentation

Reported by: seddonym 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


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 seddonym 14 months ago.

Download all attachments as: .zip

Change History (7)

Changed 14 months ago by seddonym

comment:1 Changed 14 months ago by seddonym

  • Cc Seddon added
  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 14 months ago by seddonym

  • Easy pickings set

comment:3 Changed 14 months ago by bmispelon

  • Cc bmispelon@… added
  • Triage Stage changed from Unreviewed to Accepted

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 14 months ago by timo

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:5 Changed 14 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 8365d76da01af1d4391cba32d62178791d074b06:

Fixed #20513 - Expanded docs on QuerySet caching.

Thanks seddonym.

comment:6 Changed 14 months ago by Tim Graham <timograham@…>

In 2e026739dcab545703160456503a1183c6c0702d:

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

Thanks seddonym.

Backport of 8365d76da0 from master

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.