A
A
altertable2020-06-04 20:09:44
Django
altertable, 2020-06-04 20:09:44

Django 3 how to fix loop?

I have a "Halls" table, when I fill this table
and save it, the following happens:
the save() method is called and the "Place" table is filled in a loop according to the data taken from the "halls"
(number_of_rows, places_in_row)

but I have sectors ( green, orange, red ), and I need to somehow divide these rows into sectors
for example: I have 7 rows, and I need to divide these rows into sectors
2 rows - belong to the 'green' sector
3 rows - belong to the 'orange' sector '
2 rows - belong to the 'red' sector
or 2, 2 ,3
or 3, 2, 2

(2+3+2 = 7)

can be used how can I implement this in a cycle ?????????

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question