Opened 4 years ago
Last modified 4 years ago
#32399 closed New feature
Allow method_decorator to handle multiple functions — at Version 1
Reported by: | Alexey Kotenko | Owned by: | nobody |
---|---|---|---|
Component: | Utilities | Version: | dev |
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 (last modified by )
Allowing method_decorator
to handle multiple function names would avoid invoking it multiple times:
@method_decorator(login_required, name='get') @method_decorator(login_required, name='post') class SimpleView(View): ...
Instead of this lets modify function to polymorpic style:
@method_decorator(login_required, name=['get', 'post']) class SimpleView(View): ...
Note:
See TracTickets
for help on using tickets.