Re: Stupid template question

2007-12-15 Thread rskm1
On Dec 14, 1:03 am, Steve Freitas <[EMAIL PROTECTED]> wrote: > Only, it doesn't work. It seems like . lookups > require the argument to be a literal, not a variable. Grindizer addresses your specific problem of enumerating key/value pairs in a template (piece of cake!), but if you still wanted

Re: Stupid template question

2007-12-14 Thread Grindizer
have you take a look at the django documentation ? http://www.djangoproject.com/documentation/templates/#for Because we can see this :) {% for key, value in data.items %} {{ key }}: {{ value }} {% endfor %} On 14 déc, 08:03, Steve Freitas <[EMAIL PROTECTED]> wrote: > I have a dictionary,

Re: Stupid template question

2007-12-14 Thread etng
It seems that you've made a typo. change {{myDict.key}} to {{myDict.keys}} On Dec 14, 2007 3:03 PM, Steve Freitas <[EMAIL PROTECTED]> wrote: > > I have a dictionary, and I'd like to iterate over the keys, using the > keys to look up the result, like: > > {% for key in myDict %} > The key is

Stupid template question

2007-12-13 Thread Steve Freitas
I have a dictionary, and I'd like to iterate over the keys, using the keys to look up the result, like: {% for key in myDict %} The key is {{key}} and the value is {{myDict.key}}. {% endfor %} Only, it doesn't work. It seems like . lookups require the argument to be a literal, not a variable.