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
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
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
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
4 matches
Mail list logo