Avoid using {% cycle %} for Django 1.2-1.6 compatibility

This commit is contained in:
Bradley Ayers 2013-03-24 15:35:32 +11:00
parent 184484f851
commit 80a6875cf9
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@
<tbody>
{% for row in table.page.object_list|default:table.rows %} {# support pagination #}
{% block table.tbody.row %}
<tr class="{% cycle "odd" "even" %}">
<tr class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }}"> {# avoid cycle for Django 1.2-1.6 compatibility #}
{% for column, cell in row.items %}
<td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
{% endfor %}