Opened 19 years ago

Closed 18 years ago

Last modified 18 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

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.

Change History (3)

comment:1 by hugo, 19 years ago

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 by eugene@…, 19 years ago

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

comment:3 by Adrian Holovaty, 18 years ago

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