Q:

Django template display first 3 related to that category

In reference to this model: My Model
In the template - I want to show the first three items in one column / for loop, then another 3 in another column / for loop, e.g.
  Category 1
Item 1   Item 4
Item 2   Item 5
Item 3   Item 6

I tried using slices, but that only retrieves the first three in the object, so if the first two item belongs to Category 1, and the last item belongs to Category 2, it only show 2 items. I want to grab first 3 items for each category, then vice versa, last three items. Is this feasible in the for loop?

A:

This was the solution:
{% for item in category.categoriesfk.all|slice:"0:3" %}

