On 17/02/12 18:04, Tobia Conforto wrote:
> Hello
> 
> As a happy user of the class-based views, I wrote a couple of
> higher-level decorators to make it easy to apply all the standard
> decorators to them.
> 

> The first is an updated version of method_decorator, made to accept
> additional arguments and pass them to the original decorator:

I don't have time to comment on the other things, but I think this bit -
essentially mixing up decorators and decorator generators - is a bad
idea. The smell is apparent in the docstring:

"""
Does not support decorators with call but without arguments: @my_dec()
"""

And my past experience has shown that this is a bad thing. It can get
diabolical if you try to apply some further higher level thing to
method_decorator itself.

Here is what is sometimes caused by attempting the convenience of
flexibility in the calling convention:

https://code.djangoproject.com/browser/django/trunk/django/views/decorators/cache.py?rev=17484#L7

Regards,

Luke

-- 
"I asked mom if I was a gifted child. She said they certainly
wouldn't have paid for me." (Calvin and Hobbes)

Luke Plant || http://lukeplant.me.uk/

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to