Using template filters doesn't guarantee that given template is rendered in RequestContext, not in Context. so, you still have to use threadlocal to pass request through. You may look at middleware framework to save request variable at threadlocal in less dirty way. Also you may subclass template loaders and replace ones in settings.py to avoid monkey-patching.
Yes, there are some curious moments. But after months of Pylons, Zope2/3 and even Grok I came back to Django with a firm belief that Django is a "better of two evils" :) On Tue, Oct 13, 2009 at 11:32 PM, Nan <ringe...@gmail.com> wrote: > > > As an aside, it seems curious to me that in a generally flexible > framework like Django a problem like this should have only a dirty > solution. I've encountered a few instances where it would be useful > to have access to request variables, but there's no way to pass them. > > > On Oct 13, 3:10 pm, Михаил Лукин <mihail.lu...@googlemail.com> wrote: > > Seems that any solution would be dirty, so why don't you set threadlocal > > variable with request and monkey-patch template loader? > > > -- regards, Mihail --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---