Thank you very much everybody. I suspect that was a trunk's functionality.
I solved it using a list of tuples. Thanks again. On 26 feb, 00:02, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-02-25 at 10:21 -0800, Jose Jiménez wrote: > > Hello everybody, > > > i'm developing an application with the lates stable release of django > > (0.96). > > In the trunk version, i can do "for key, value in variable", but in > > the 0.96 version i take an error: > > > 'for' statements with five words should end in 'reversed': for key, > > value in variable > > > How can i access to the key and the value of all elements of a > > dictionary? If i do: for a in variable, a is the key, but i can't > > access its value. > > So you are talking about the "for" template tag here, not Python code > (best to be clear about that). It also sounds like your "variable" is a > dictionary from your use of the words "key" and "value". Working on > those assumptions: > > {% for value in variable.items %} > {{ value.0 }} is the key > {{ value.1 }} is the value > {% endfor %} > > Here, variable.items returns a tuple and you can access the items in a > tuple via value.0 and value.1. > > Malcolm > > -- > Why can't you be a non-conformist like everyone > else?http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---