title: Django - accessing the RequestContext from within a custom filter
body: <p>I've got a filter <code>currency</code>, which takes a value in USD and converts it to a currency (either USD or GBP). The currency to convert to is stored in the session, but filters don't take <code>RequestContext</code>, so I can't grab it straight from there.</p>
  
  <p>Is there a better way than passing the relevant session element into the template, and from the template into the filter as an argument? Whilst this approach is working, it seems fairly horrible, and I'm likely to end up passing the currency to (almost) every template.</p>
  
  <p>My filter currently looks something like this:</p>
  
  <pre><code>def currency(value, currency):
      if currency == 'usd':
         val = '$%.2f' % value
         return mark_safe(val)
  
      d = Decimal(value)
      val = '&amp;pound;%.2f' % (d*Decimal('0.63'))
  
      return mark_safe(val)
  </code></pre>