#5865: cycle template tag should accept a single argument
-----------------------+----------------------------------------------------
Reporter: gwilson | Owner: nobody
Status: new | Component: Template system
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 0
-----------------------+----------------------------------------------------
When passed a single argument, the cycle tag should treat it as an
iterable to cycle through. For example, with the context:
{{{
#!python
{'colors': ['red', 'blue', 'green']}
}}}
you should be able to have a template like:
{{{
#!xml
{% for row in mydata %}
<tr class="{% cycle colors %}">...</tr>
{% endfor %}
}}}
that would output:
{{{
#!xml
<tr class="red">...</tr>
<tr class="blue">...</tr>
<tr class="green">...</tr>
<tr class="red">...</tr>
...
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5865>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---