2008/5/2 Nathaniel Whiteinge <[EMAIL PROTECTED]>:
>
> On May 1, 10:04 am, "Guillaume Lederrey"
>
> <[EMAIL PROTECTED]> wrote:
> > This of course doesnt work because the request isnt in the scope. I
> > could redefine a view in my views.py and do the work on the request
> > manually, but i have a feeling there is a solution to do that directly
> > in my urls.py.
>
> Sorry, there isn't a way to get at the request object in your urlconf.
> You'll have to make a wrapper around the generic view -- when the
> wrapper is small, I often just put it in my ``urls.py``::
>
> from django.conf.urls.defaults import *
> from whereever.youput.create_update import update_object
>
> urlpatterns = patterns('',
> ('^pattern/$', 'path.to.this.urlconf.mywrapper'),
> )
>
> def mywrapper(request):
> ...
> return update_object(request, ...)
I havent done any functional programming in a long time , but ... isnt
there a way to use an anonymous function (if that's what it is called)
and do the wrapper "inline" ? Something like :
urlpatterns = patterns('',
('^pattern/$', lambda(request)(
return update_object(request, ...)
),
)
Thanks for your help !
--
Jabber : [EMAIL PROTECTED]
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.ledcom.ch/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---