What am I trying to achieve will be easier to explain on lists. e.g
list_of_blocks=[1,2,3,4,5,6,7,8,9,10,11,12]
block_first_row = list_of_blocks[:3]
block_rest_rows = [list_of_blocks[i:i+4] for i in range(3, len(list_of_blocks), 4)]
block_rows = block_rest_rows.insert(0, list_of_blocks)
I want to group blocks from StreamField and display them in template grouped by those rows. Is there a way to do it in my model? Or should i do it somehow in template.. I've tried to do:
- operate on StreamField as on list
- deconstuct StreamField.. then operate as on list