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 Alexey Kotenko)

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):
    ...

Change History (1)

comment:1 by Alexey Kotenko, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top