Opened 17 years ago

Closed 16 years ago

Last modified 16 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: no UI/UX: no


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.

Change History (3)

comment:1 Changed 17 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 is as good a place for that as any other file ;-)

comment:2 Changed 17 years ago by eugene@…

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

comment:3 Changed 16 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed

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

Note: See TracTickets for help on using tickets.
Back to Top