On Wed, 2009-03-25 at 05:23 -0700, foxbunny wrote:
> I am trying to write a custom template filter which takes a variable
> which is a model object and grabs fields from a related object based
> on request.session['lang'] parameter. Or it would if I knew how to get
> the `lang` parameter from within the filter code.

Unless this information is explicitly passed into the template, you
won't have access to it. Template rendering is deliberately independent
of the request/response infrastructure, since it can be used in
situations where "request" doesn't make sense. However, if you really
just want the active language, have a look at how the
get_current_language template tag is implemented.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to