rentals: Reverse ordering of locker numbers
Because for some reason, our lockers are numbered right to left
This commit is contained in:
parent
d41dc9044c
commit
bd9ce2457b
@ -38,13 +38,13 @@ class LockerUnit(models.Model):
|
||||
def __str__(self):
|
||||
last_letter = chr(ord(self.first_letter) + self.columns - 1)
|
||||
last_number = self.first_number + self.columns * self.rows
|
||||
return f"{self.bank.name} (Unit {self.first_letter}{self.first_number}-{last_letter}{last_number})"
|
||||
return f"{self.bank.name} (Unit {last_letter}{self.first_number}-{self.first_letter}{last_number})"
|
||||
|
||||
def letter_for_column(self, column: int) -> str:
|
||||
return chr(column + ord(self.first_letter))
|
||||
|
||||
def number_for_locker(self, column: int, row: int) -> int:
|
||||
return row + self.first_number + column * self.rows
|
||||
return row + self.first_number + (self.columns - column - 1) * self.rows
|
||||
|
||||
@property
|
||||
def iter_doors(self):
|
||||
|
Loading…
Reference in New Issue
Block a user