Opened 12 years ago

Closed 12 years ago

#18952 closed Cleanup/optimization (wontfix)

template syntax to access individual elements of a list

Reported by: mail@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: template syntax
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Maybe this is too trivial but I think that in addition to "first" and
"last" it could be mentioned at
https://docs.djangoproject.com/en/1.4/ref/templates/builtins/
that {{ value.0 }}, {{ value.1 }}, {{
value.2 }}, etc. can be used to access individual elements of a list.

Change History (1)

comment:1 by Tim Graham, 12 years ago

Resolution: wontfix
Status: newclosed

Thanks for the suggestion, but I don't think this is the best place for that bit of info since .0, .1 aren't filters. List lookup is described here: https://docs.djangoproject.com/en/dev/topics/templates/

Note: See TracTickets for help on using tickets.
Back to Top