There is no current way to do this(there was a thread on django-dev a
few weeks ago and there was no consensus on syntax), what I would do
is create a very simple filter, if will be all of 3 lines long and
will accomplish what you need.

On Apr 18, 2:47 pm, Salim Fadhley <[EMAIL PROTECTED]> wrote:
> In my example "reportdatedate" is a datetime object. "result" is a
> dict of dicts.
>
> The lines that attempt to access the dict cause a template syntax
> error ( because I invented the syntax myself ) - is there an
> alternative that means the same thing?
>
> I note that Django templates give me an obvious syntax when the dict-
> key names are known in advance: {{ mydict.keyname }}, but what do I do
> when (as in my example below) the key names are provided by another
> variable?
>
> Thanks
>
> {% for reportdate in allDates %}
>         <tr>
>                 <td>
>                 {{ reportdate }}
>                 </td>
>                 {{ result[ reportdate ][ "dev" ] }}
>                 <td>
>                 <td></td>
>                 <td>
>                 {{ result[ reportdate ][ "live" ] }}
>                 </td>
>         </tr>
> {% endfor %}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to