Re: Decoration of class based views

2015-08-11 Thread Fabrizio Messina
Sorry to keep it alive, but what about the ability to pass an iterator to the method_decorator? It would be sightly similar to this: def _wrapper(self, *args, **kwargs): def bound_func(*args2, **kwargs2): return func.__get__(self, type(self))(*args2,

Re: Decoration of class based views

2015-08-07 Thread Fabrizio Messina
Sorry did read the commit code now and the new *method_decorator* seems to solve most of the problem On Thursday, August 6, 2015 at 11:21:36 AM UTC, Fabrizio Messina wrote: > > Hello I would like to ask why the class based views documentation seems so > much ugly. Some developers probably are

Re: Decoration of class based views

2015-08-07 Thread Fabrizio Messina
No my point is that the proposed solution: https://docs.djangoproject.com/en/1.8/topics/class-based-views/intro/#decorating-in-urlconf will couple logic inside the urlconf and the methodology itself tend to create hard to read code. Still I think it makes sense to choose to wrap the

Re: Decoration of class based views

2015-08-06 Thread Tim Graham
A few days ago, we added the ability to use @method_decorator at the class level: https://github.com/django/django/commit/3bdaaf6777804d33ee46cdb5a889b8cc544a91f1 Does it help? Is your proposal to add the reduce() syntax to the docs? On Thursday, August 6, 2015 at 7:21:36 AM UTC-4, Fabrizio

Decoration of class based views

2015-08-06 Thread Fabrizio Messina
Hello I would like to ask why the class based views documentation seems so much ugly. Some developers probably are scared by these just because the decoration is ugly, the documentation offers three ways: Decorate the *Klass().dispach()* method of the class, wrapping the decorators in another