Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2836 closed enhancement (worksforme)

nested for

Reported by: anonymous Owned by: adrian
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: UI/UX:

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 %}

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to worksforme
  • Status changed from new to closed

Hey there,

The Django template system already supports nested for loops and nested if statements.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.