that's right!
thank you!
I don't know how I missed that information in the doc...
On 29 sep, 23:51, Javier Guerra wrote:
> sorry, the right syntax is
>
> {% for key, element in toto.items %}
> Name: {{ element.name }} - Desc: {{ element.desc }}
> {% endfor %}
>
> (as documented
> inhttp:/
sorry, the right syntax is
{% for key, element in toto.items %}
Name: {{ element.name }} - Desc: {{ element.desc }}
{% endfor %}
(as documented in
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for )
--
Javier
--~--~-~--~~~---~--~~
You recei
It doesn't change anything
On 29 sep, 21:39, Javier Guerra wrote:
> On Tue, Sep 29, 2009 at 2:35 PM, gontran wrote:
> > In my template, I want to access to the name and to the desc of each
> > key of toto:
> > {% for element in toto %}
> > Name: {{ element.name }} - Desc: {{ element.desc }}
On Tue, Sep 29, 2009 at 2:35 PM, gontran wrote:
> In my template, I want to access to the name and to the desc of each
> key of toto:
> {% for element in toto %}
> Name: {{ element.name }} - Desc: {{ element.desc }}
> {% endfor %}
try:
{% for key, element in toto %}
Name: {{ element.name
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['45
5 matches
Mail list logo