Re: dictionary access in templates

2007-09-26 Thread AO'R
As far as I know, the tour_dict.tour approach does not work because "template variable dictionary lookups use arguments as strings not as variable names" ( http://code.djangoproject.com/ticket/1495 ) I use a solution like this: {% for tour in tourset %} {% for dict_item in tour_dict.items %} {% i

Re: dictionary access in templates

2007-09-25 Thread AndyB
Django templates use the dot syntax for several purposes: object attributes, dictionary lookups, list indexes and method calls. Have a look here: http://www.djangoproject.com/documentation/templates/#variables (note that you can't pass parameters to method calls so only methods calls that don't r

Re: dictionary access in templates

2007-09-24 Thread Kenneth Gonsalves
On 25-Sep-07, at 10:23 AM, Oleg Korsak wrote: > Hello! I have many `tour` objects as a key for a `tour_dict` > dictionary. > How can I access tour_dict values using tour? Like tour_dict[tour]... > template will not work with [ ] how about tour_dict.tour? -- regards kg http://lawgon.livejou

dictionary access in templates

2007-09-24 Thread Oleg Korsak
Hello! I have many `tour` objects as a key for a `tour_dict` dictionary. How can I access tour_dict values using tour? Like tour_dict[tour]... template will not work with [ ] signature.asc Description: OpenPGP digital signature