Re: Add "view_decorators" to django.views.generic.View

2015-12-22 Thread Marc Tamlyn
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

Re: Add "view_decorators" to django.views.generic.View

2015-12-21 Thread Tim Graham
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

Re: Add "view_decorators" to django.views.generic.View

2015-12-21 Thread Carl Johnson
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

Add "view_decorators" to django.views.generic.View

2015-12-21 Thread Curtis
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