I am making an on-line theater booking app in django (v1.10.5) and python.
models.py:
TheaterLocation = [
(1, 'Naharlagun'),
]
FloorLevel = [
(1, 'Ground Floor'),
(2, 'Balcony'),
]
Row = [
]
Column = [
]
class Seat(models.Model):
theater_location = models.PositiveIntegerField(choices=TheaterLocation)
floor_level = models.PositiveIntegerField(choices=FloorLevel)
row_id = models.PositiveIntegerField()
column_id = models.PositiveIntegerField()
@property
def seat_id(self):
return "%s : %s : %s : %s" % (self.theater_location, self.floor_level, self.row_id, self.column_id)
What I would like to do is, create a list of choices for Row
and Column
automatically like this:
Row = [
(1, 'A'),
(2, 'B'),
...
...
(8, 'H'),
]
Column = [
1,2,3,4,5, ... , 22
]
How can I achieve like the above?