Code

Opened 17 months ago

Closed 9 months ago

#19320 closed New feature (duplicate)

Ability to leverage cache key generation for cache templatetag

Reported by: Alex hayes <alex@…> Owned by: nobody
Component: Core (Cache system) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Its currently not possible to leverage the code that generates a cache key in templatetag cache as its embedded inside django.templatetags.cache.CacheNode.render.

It would be useful to be able to generate these cache keys if you need to programatically delete them and it appears there are a number of gist's and other solutions floating around, but none of them are done in a DRY nature.

I propose that a method get_cache_key be part of the django.templatetags.cache module.

Attachments (0)

Change History (5)

comment:1 Changed 17 months ago by Alex hayes <alex@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I've committed a fix for this in https://github.com/alexhayes/django/commit/0c8b693713dc4bd28bbdd4238b4294b4d310a66e

I'll be submitting a pull request shortly.

comment:2 Changed 17 months ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 11 months ago by timo

  • Has patch set

comment:4 Changed 9 months ago by timo

  • Needs documentation set

As noted on the PR, this should be documented.

comment:5 Changed 9 months ago by timo

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

Duplicate of #19253

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.