Opened 4 years ago

Last modified 4 years ago

#32399 closed New feature

Allow method_decorator to handle multiple functions — at Initial Version

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

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 SimpledView(View):
    ...

Change History (0)

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