On Sep 16, 2011, at 6:19 PM, Donald Stufft wrote:
Documentation is being worked on, and is orthogonal to the current
discussion of how
to handle things like requiring logins with the new CBVs.
I just watched "Class Decorators: Radically Simple" by Jack Diederich,
who wrote the class decorators PEP, and I think it's very useful to
watch (25 min.) for this discussion. According to him it is good
practice to return the class that is decorated, which I think we
should follow, and which solves the biggest practical problems with
decorating. Moreover, the fact that class decorators exist indicate
that they are pythonic. So +1 for the decorators.
Considering the mixins: IMHO, the order of base classes shouldn't
matter. Can this be satisfied by the mixin-approach?
@Carl Meyer: I would opt for applying decorators *in* the class, so
you can still derive from it. Like::
class MyView(View):
@classonlymethod
def as_view(cls, *args, **kwargs):
return login_required(super(MyView, cls).as_view(*args,
**kwargs))
Cheers, Roald
--
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.