#13879: method_decorator doesn't supports decorators with arguments
------------------------------------+---------------------------------------
Reporter: marinho | Owner: nobody
Status: new | Milestone: 1.3
Component: Uncategorized | Version: 1.2
Resolution: | Keywords: sprintnov13, decorators
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by lukeplant):
* stage: Design decision needed => Accepted
Comment:
Technically, `method_decorator` works as advertised. `permission_required`
is not actually a decorator. `permission_required('spam.more_eggs')` is a
decorator, and `permission_required` is a decorator ''generator'' (it
returns a decorator when you call it with some arguments).
But I agree that the goal set out lrekucki is a good one, and that a
`method_decorator_with_args` (or some better name) would be desirable, and
that the OP's solution is not a good idea.
--
Ticket URL: <http://code.djangoproject.com/ticket/13879#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.