Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#18110 closed Cleanup/optimization (fixed)

Improve template cache tag documentation

Reported by: julianb Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: florian+django@… Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For me it was not clear that the fragment name cannot be a variable. I just found out by wondering about errors and having a quick look into Django's code. It should be made more clear that the second argument will not be resolved even though all the others will be (even the cache time gets resolved).

"It takes at least two arguments: the cache timeout, in seconds, and the name to give the cache fragment. For example:"

should at least be something like

"It takes at least two arguments: the cache timeout, in seconds, and the name to give the cache fragment. The name will be taken as is, do not use a variable. For example:"

https://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching

Attachments (0)

Change History (6)

comment:1 Changed 2 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by apollo13

Shouldn't we instead add a new cache tag to our future library to get this tag in line with the other tags (like we did with url and ssi)?

comment:3 Changed 2 years ago by apollo13

  • Cc florian+django@… added

comment:4 Changed 2 years ago by anonymous

  • Triage Stage changed from Accepted to Ready for checkin

There's an open pull request at https://github.com/django/django/pull/153

comment:5 Changed 2 years ago by Julian Bez <web-spy@…>

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

In [3c0877938f5eafc822d32b6c4f85e5a46b873390]:

Fixed #18110 -- Improve template cache tag documentation

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

In [84c3c9097d4a240ae2880ba272a207b96ddf7553]:

Merge pull request #153 from webjunkie/patch-1

Fixed #18110 -- Improve template cache tag documentation

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.