我想在django模板中做一个for for循环(对于int x = 0; x < 3; x ++)。我应该怎么做? 伪代码如下所示:在模板中做一个for循环
{% for Summary in Summary_list %}
{% ifchanged Summary.bu_id %}
</tr>
<tr>
<td>{{Summary.bu.version}}</td>
{% if Summary.platform_id != 1 %}
{% for x less than Summary.platform_id %}
<td><center>-</center></td>
{% x++ %}
{#我应该怎么做这个部分? #}
<td> <center>{{Summary.successCount}}</center></td>
{% else %}
<td><center> {{Summary.successCount}}</center></td>
{% endifchanged %}
{% endfor %}
非常感谢!
的可能重复:http://stackoverflow.com/questions/1107737/numeric- for-loop-in-django-templates – sberry 2010-08-12 03:57:21