Personally, I find that decorators aren't the best way of interacting with
CBVs. They're useful when you have a mixed style codebase, but I tend to
convert the decorator into a mixin applied at the appropriate point. I
think the style of decorating in the URLconf is horrible.

Marc

On 21 December 2015 at 17:19, Tim Graham <[email protected]> wrote:

> Could you summarize the pros and cons of this new technique versus the
> existing @method_decorator() recommendation [1]? Does it duplicate all the
> functionality provided by method_decorator such that we would no longer
> recommend that technique in the class-based view docs?
>
> [1]
> https://docs.djangoproject.com/en/dev/topics/class-based-views/intro/#decorating-the-class
>
> On Monday, December 21, 2015 at 12:03:15 PM UTC-5, Carl Johnson wrote:
>>
>> I would find that useful. In my experience, I often have a mixture of CBV
>> and non-CBV code, and it's annoying to shoehorn decorators into the as_view
>> method. It would be much more convenient to just add to
>> self.view_decorators.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/39d40372-9e63-4dfc-9378-b2187a95bd25%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/39d40372-9e63-4dfc-9378-b2187a95bd25%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1F09G%2BDmoZB6uQGD-uoQPNuyF5phupFcAxFukx_kkZ-3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to