According to youre link my synthax was correct:
* Dictionary lookup. Example: foo["bar"]
* Attribute lookup. Example: foo.bar
* Method call. Example: foo.bar()
* List-index lookup. Example: foo[bar]
Anyway none of those work :-(
. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
XSLT-Entwickler
LexisNexis
Marxergasse 25, 1030 Wien
mailto:[email protected]
Tel.: +43 (1) 534 52 - 1573
Fax: +43 (1) 534 52 - 146
-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im
Auftrag von Tom Evans
Gesendet: Dienstag, 15. Februar 2011 15:24
An: [email protected]
Betreff: Re: list to template
On Tue, Feb 15, 2011 at 2:09 PM, Szabo, Patrick (LNG-VIE)
<[email protected]> wrote:
> Hi,
>
> Now when i try to acces that lists with
>
> {{ buchung[0][0] }}
>
This isn't particularly well documented, best I could find is this:
http://docs.djangoproject.com/en/1.2/ref/templates/api/#rendering-a-context
Templates use '.' as a special lookup when used in a variable name.
You can use a dot to do dictionary lookup, attribute lookup, method
calls and list index lookup. What you are trying to do is the latter.
The correct way of doing it is:
{{ buchung.0.0 }}
Cheers
Tom
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.