#32399: Allow method_decorator to handle multiple functions
--------------------------------+--------------------------------------
     Reporter:  Alexey Kotenko  |                    Owner:  nobody
         Type:  New feature     |                   Status:  new
    Component:  Utilities       |                  Version:  master
     Severity:  Normal          |               Resolution:
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------
Description changed by Alexey Kotenko:

Old description:

> Allowing `method_decorator` to handle multiple function names would avoid
> invoking it multiple times:
>
> {{{#!python
> @method_decorator(login_required, name='get')
> @method_decorator(login_required, name='post')
> class SimpleView(View):
>     ...
> }}}
>
> Instead of this lets modify function to polymorpic style:
> {{{#!python
> @method_decorator(login_required, name=['get', 'post'])
> class SimpledView(View):
>     ...
> }}}

New description:

 Allowing `method_decorator` to handle multiple function names would avoid
 invoking it multiple times:

 {{{#!python
 @method_decorator(login_required, name='get')
 @method_decorator(login_required, name='post')
 class SimpleView(View):
     ...
 }}}

 Instead of this lets modify function to polymorpic style:
 {{{#!python
 @method_decorator(login_required, name=['get', 'post'])
 class SimpleView(View):
     ...
 }}}

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32399#comment:1>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.1c321b404896bf16265a500c136a4997%40djangoproject.com.

Reply via email to