So here\'s my problem: I\'ve got a bunch of instances of a class. I would like to have a sort of table of these instance objects, so that there is a maximum of six in every
Since forloop.counter starts the index with 1, divisibleby 3 does not work. So use forloop.counter0 instead.
{% for product in all_products %} {% if forloop.counter0|divisibleby:3 %} {% endif %} {% endfor %} 0 讨论(0) 查看其它5个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复