On Wed, 2010-10-20 at 16:05 +0200, Łukasz Rekucki wrote:

> OTOH, it's annoying to have to write an dispatch() method with a super
> inside (which effectively does nothing), just to apply a decorator.

That's a good point I hadn't thought of, as are Russell's other points.

Just to put it on the table, another option we thought of at one point
was to have a 'decorators' attribute on the class, which is a list of
decorators that is applied by the as_view() method.  It would in theory
allow you to add decorators to either end of the set of decorators that
are applied, something like this:

class MyView(SomeOtherView):

    decorators = SomeOtherView.decorators + [my_dec_1, my_dec_2]

It gets a bit trickier with multiple inheritance.  I don't know if that
would be too much of a big deal - I would imagine that most of the mixin
classes would not be providing decorators.  But then my imagination is
probably limited.

Luke

-- 
If you can't answer a man's arguments, all is not lost; you can 
still call him vile names. (Elbert Hubbard)

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-develop...@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