On Oct 4, 10:55 pm, "David P. Novakovic" <davidnovako...@gmail.com>
wrote:
> On Tue, Oct 5, 2010 at 5:21 AM, George Sakkis <george.sak...@gmail.com> wrote:
>
> > Since dispatch is going to be defined on the base View class, can't we
> > omit it from the urlconf and have the URLresolver do:
>
> >  if isinstance(view, type) and issubclass(view, View):
> >      view = view.dispatch
>
> Russ mentioned this one can't be decorated.

What does "this" refer to here ? It's just a shortcut for the common
case, you can always decorate the SomeClassView.dispatch:

url("^articles1/$", ArticlesView.dispatch),                 #
undecorated
url("^articles2/$", login_required(ArticlesView.dispatch)), #
decorated

url("^articles3/$", ArticlesView),                   # shortcut of the
first
# url("^articles4/$", login_required(ArticlesView)), # this doesn't
work

There is an asymmetry here but that's not to say it can't be
decorated, you just have to decorate the dispatch method instead of
the class view.

George

-- 
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