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
You could make the code a bit more generic. Here's the logic:
queryset = Class.objects.all() set_length = queryset.count() {% for i in queryset %} i.attr i.attr {% if forloop.counter|divisibleby:"6" or forloop.last %} {% endif %} {% endfor %}
i.attr
I hope this solves your problem :-)