Hi all,
I have a problem where i have a list which stores a bunch of relevant
key to another dictionary. I want to loop through the list and print
out the information contained in the keys to output.
Apparently it doesn't work.
So for example i have the following:
lst = ["a", "b"]
dic = {"a":1, "b":2, "c":3}
I wish to print out 1 and 2 but not 3.
If i do the following, it doesn't work:
{% for t in lst %}
{{ dic.t}}
{% endfor %}
Does anyone have any suggestions on how to accomplish this?
Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---