Does anyone know of a way to use a variable as a dictionary key within
a template?

I want to be able to do something like this:

{% for key in dictionary.keys %}
  ... be able to use {{ key }} and "{{ dictionary.key }}" ...
{% endfor %}

dictionary.key assumes the string 'key' is the actual value to lookup
(using dictionary, attribute, method, and list priority).  In this
case, the value for key is never resolved.

I have tried a number of combinations to get this to work.  Has anyone
been able to do this successfully?  I have a number of work arounds in
my code for this, but it is forcing the template process to be much
more specific to the view.


Thanks,

Sarah

Reply via email to