Opened 13 years ago
Closed 13 years ago
#18952 closed Cleanup/optimization (wontfix)
template syntax to access individual elements of a list
| Reported by: | 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.
Note:
See TracTickets
for help on using tickets.
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/