I'm having a problem when printing the template. I want something
like:
{% i in item %}
{{ form.{{i}}.error }}
{{ {{i}}_max }}
{{ {{i}}_min }}
{% endfor %}
-- which obviously doesn't work
so, from my views.py I passed in a dictionary containing, a list of
items - [a, b, c, d], a list of form - [a,b,c,d] as well as a_max,
a_min, b_max, b_min, etc ...
what I want to do is to print the actual value of a_max, a_min, b_max,
b_min, using the for loop (so I don't have to hard code it. Is there
any way to achieve this? I mean how to call a { } inside another { }
I've tried using expr:
{% expr i+'_max' as maximum %}
{{ maximum }}
-- but (as expected), it printed the word "a_max" instead of the
actual value of a_max (e.g: 9)
Any comments/suggestion would be greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---