Re: Named URLs and class-based generic views

2010-12-03 Thread Łukasz Rekucki
On 3 December 2010 22:40, Andrew Willey wrote: > So it works as > >> url(r'^location/$', WouldLoveToHaveClassBasedView.as_view(), >> name='name_for_convenience') > > Didn't realize I could just pass the class object.  Makes sense. > Guess I'm getting old and change fearing. To be clear here - yo

Re: Named URLs and class-based generic views

2010-12-03 Thread wayne
> I think the only thing that's bugging me is that you have to include > the whole views.py in your url conf.  Just feels less graceful than > having the dispatcher nab what it needs on demand.  I'll get over it. > Yeah, it does feel less graceful, doesn't it? That said, there might be a way, I

Re: Named URLs and class-based generic views

2010-12-03 Thread Andrew Willey
So it works as > url(r'^location/$', WouldLoveToHaveClassBasedView.as_view(), > name='name_for_convenience') Didn't realize I could just pass the class object. Makes sense. Guess I'm getting old and change fearing. I think the only thing that's bugging me is that you have to include the whole

Re: Named URLs and class-based generic views

2010-12-03 Thread Daniel Roseman
On Dec 3, 8:47 pm, Andrew Willey wrote: > Forgot to in mention the actual question from the subject. > > Is there a "blessed" way to use class-based views with named urls in > the > > > url(r'^location/$', view='WouldLoveToHaveClassBasedView.as_view', > > name='name_for_convenience') > I don't u

Re: Named URLs and class-based generic views

2010-12-03 Thread wayne
On Dec 3, 2:47 pm, Andrew Willey wrote: > Forgot to in mention the actual question from the subject. > > Is there a "blessed" way to use class-based views with named urls in > the > > > url(r'^location/$', view='WouldLoveToHaveClassBasedView.as_view', > > name='name_for_convenience') > Oh, I see

Re: Named URLs and class-based generic views

2010-12-03 Thread Andrew Willey
Forgot to in mention the actual question from the subject. Is there a "blessed" way to use class-based views with named urls in the > url(r'^location/$', view='WouldLoveToHaveClassBasedView.as_view', > name='name_for_convenience') On Dec 3, 1:46 pm, Andrew Willey wrote: > Can someone point me i

Re: Named URLs and class-based generic views

2010-12-03 Thread wayne
On Dec 3, 1:46 pm, Andrew Willey wrote: > Can someone point me in the right direction here? > > How does one use class-based generic views and named URLs? > > Example (doesn't work): > > > urls.py > > urlpatterns += patterns('myapp.views', > >    (r'^location/$', MyGenericView.as_view()), > > )

Named URLs and class-based generic views

2010-12-03 Thread Andrew Willey
Can someone point me in the right direction here? How does one use class-based generic views and named URLs? Example (doesn't work): > urls.py > urlpatterns += patterns('myapp.views', >(r'^location/$', MyGenericView.as_view()), > ) > views.py > class MyGenericView(TemplateView): >templa