#2836 closed enhancement (worksforme)
nested for
Reported by: | anonymous | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Template system | Version: | 0.95 |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
it'd be cool if django had nested {% for %} for it's template system.
for example if pass a dict like this to the template system:
{'myvar': {'list': [<Object: Thing1>, <Object: Thing2>], 'list2': [<Object: OtherThing1>, <Object: OtherThing1>] }, 'myvar2': 'bla'}
and then in the template sys:
{% for lists in myvar %}
{% for object in lists %}
{{ object.attribut }}
{% endfor %}
{% endfor %}
Note:
See TracTickets
for help on using tickets.
Hey there,
The Django template system already supports nested for loops and nested if statements.