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
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.djan
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 Goo
Hey all,
Tim wanted me to open some discussion on this idea:
https://github.com/django/django/pull/5637/files
Essentially, it allows you to add an explicit list of decorators for a
View to apply to its view function when someone calls as_view.
This allows the View author to dictate which dec