Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1016 closed enhancement (wontfix)

Ability to specify decorators for generic views

Reported by: eugene@… Owned by: jacob
Component: Generic views Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

At present time the only way to specify view decorators (e.g., conditional caching) for generic views is to wrap them in custom views. It would be desirable to have a shortcut for that.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by hugo

you can just do normal assignments (the Python 2.3 syntax for decorators):

from django.views.generic.list_detail import object_detail

modified_object_detail = vary_on_cookie(object_detail)

So you don't need to do any custom view, you just call the decorator on the generic one. Ok, you have to put that into some module somewhere, but views.py is as good a place for that as any other file ;-)

comment:2 Changed 8 years ago by eugene@…

That's what I finally did. And copied-and-pasted in all apps.

comment:3 Changed 8 years ago by adrian

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

Closing for the reason pointed out by Hugo in the above comment.

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.