Opened 13 years ago
Closed 13 years ago
#16892 closed New feature (duplicate)
Allow class based view 'cache_timeout' to control middleware.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Generic views | Version: | 1.3 |
Severity: | Normal | Keywords: | CBV Cache |
Cc: | preston@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Allow cache timeout to be controlled by an attribute ('cache_timeout') on class based views. This allows cache timeout to be controlled on groups of views with inheritance (or mixins) without having to implement settings for each individual view.
It relies on setting the class based view into an attribute of the view function created by View.as_view. This can then be checked for and interrogated in the UpdateCacheMiddleware.
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | class-based-view-caching.diff added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
This is really a specific case of #14512, in particular, the issue of representing decorator parameters as inheritable class attribute
class based cache settings patch