Re: Making URLconfs accept view objects, not just paths to views

2006-05-09 Thread Honza Král
that makes sence so the answer to my question is: it would NOT be wise ;) thanks On 5/9/06, James Crasta <[EMAIL PROTECTED]> wrote: > > Wouldn't it be easy enough to support both strings and direct > references to the views? The callable() function can check that > > The logic would be something

Re: Making URLconfs accept view objects, not just paths to views

2006-05-09 Thread James Crasta
Wouldn't it be easy enough to support both strings and direct references to the views? The callable() function can check that The logic would be something like this: if callable(viewfunc): viewfunc() else: # resolve function using the older means. or you could just check if viewfunc wa

Re: Making URLconfs accept view objects, not just paths to views

2006-05-07 Thread wiktor
I do like it a lot,especially when written like this: @urlpattern('',r'^hello/$') def my_view(request): return HttpResponse('Hello world') or @simple_urlpattern( '','hello' ) def my_view(request): return HttpResponse('Hello world') Wiktor Sadowski --~--~-~--~~--

Re: Making URLconfs accept view objects, not just paths to views

2006-05-07 Thread Honza Král
+1 as well, seems more clear I would like to see all the strings (eg INSTALLED_APPS) replaced by the actual objects, but I am not sure whether its a) wise b) possible On 5/7/06, Jason Davies <[EMAIL PROTECTED]> wrote: > > +1. > > Seems more consistent and Pythonic. > > Cheers, > Jason > > > > >

Re: Making URLconfs accept view objects, not just paths to views

2006-05-07 Thread Jason Davies
+1. Seems more consistent and Pythonic. Cheers, Jason --~--~-~--~~~---~--~~ 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 unsubscri

Re: Making URLconfs accept view objects, not just paths to views

2006-05-07 Thread olive
+1 We already have to import models to use generic views, then, for the sake of consistency, it seems normal to have to import views as well. Yes, keep objects as objects everywhere is possible. --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Making URLconfs accept view objects, not just paths to views

2006-05-06 Thread pbx
> I'm thinking more and more that a nice, simple Django improvement > would be to allow URLconfs to specify the view object itself, rather > than a string representing the path to the view. >... Two small questions: Would the first positional argument to patterns() just go away? Also, how would t

Making URLconfs accept view objects, not just paths to views

2006-05-06 Thread Adrian Holovaty
I'm thinking more and more that a nice, simple Django improvement would be to allow URLconfs to specify the view object itself, rather than a string representing the path to the view. Old example: urlpatterns = patterns('', (r'^map/$', 'mysite.views.the_map'), ) New example: