Есть Django QS вида:
<QuerySet [<Seats: 1 - 1>, <Seats: 1 - 2>, <Seats: 1 - 3>, <Seats: 1 - 4>, <Seats: 1 - 5>, <Seats: 1 - 6>, <Seats: 1 - 7>, <Seats: 1 - 8>, <Seats: 2 -
1>, <Seats: 2 - 2>]>
Мне необходимо привести этот результат в list по уникальным значениям ряда, выглядеть это должно так:
filtered_list = [[<Seats: 1 - 1>, <Seats: 1 - 2>, <Seats: 1 - 3>, <Seats: 1 - 4>, <Seats: 1 - 5>, <Seats: 1 - 6>, <Seats: 1 - 7>, <Seats: 1 - 8>], [<Seats: 2 -
1>, <Seats: 2 - 2>], [<Seats: 3 - 1>, <Seats: 3 - 2>], [<Seats: 4- 1>]]
Модель состоит из:
row = models.IntegerField()
seat = models.IntegerField()
соответственно — Seats: row - seat