Hello,

here is my problem:

I have a dictionary which keys are unknown and which values are
dictionaries.
(I don't know the keys because they are dynamically created by a loop)
For example:
toto = {}
toto['123'] = {}
toto['123']['name'] = 'name of 123'
toto['123']['desc'] = 'desc of 123'
toto['456'] = {}
toto['456']['name'] = 'name of 456'
toto['456']['desc'] = 'desc of 456'

In my template, I want to access to the name and to the desc of each
key of toto:
{% for element in toto %}
    <p>Name: {{ element.name }} - Desc: {{ element.desc }}</p>
{% endfor %}

but it doesn't work.
The only things that work is:
{% for element in toto %}
    <p>{{ element }}</p>
{% endfor %}
which print:
<p>123</p>
<p>456</p>

I don't understand why.

Any help would be great.

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