Hello ! I finally choose to create a decorator to implement this functionality. I wanted something more generic than a wrapper in my urls.py. The solution seems to work fine for me, and if anybody want to do the same, the code is at http://www.djangosnippets.org/snippets/753/
Of course, any suggestions of improvements are welcomed ... MrG 2008/5/5 Nathaniel Whiteinge <[EMAIL PROTECTED]>: > > On May 4, 5:42 am, "Guillaume Lederrey" <[EMAIL PROTECTED]> > wrote: > > > 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 : > > Yeah, something like that would work, although tying it into your > example above would look pretty ugly, I'm guessing:: > > (r'^test/$', lambda request: HttpResponse('Hello, %s' % > request.user)), > > If you're only trying to get the currently logged in user into the > template context, it's already there as ``{{ user }}`` if you're using > generic views [1]. Sorry I didn't mention that in my first reply. > > .. [1] > http://www.djangoproject.com/documentation/templates_python/#django-core-context-processors-auth > > > > > -- 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 django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---