|
|
@ -20,6 +20,9 @@ class Room(models.Model):
|
|
|
|
def __str__(self):
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def valid_shifts(self):
|
|
|
|
|
|
|
|
return self.shift_set.filter(deleted=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Shift(models.Model):
|
|
|
|
class Shift(models.Model):
|
|
|
|
room = models.ForeignKey(Room, on_delete=models.RESTRICT)
|
|
|
|
room = models.ForeignKey(Room, on_delete=models.RESTRICT)
|
|
|
@ -68,6 +71,14 @@ class Shift(models.Model):
|
|
|
|
).count()
|
|
|
|
).count()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def valid_registrations(self):
|
|
|
|
|
|
|
|
return self.shiftregistration_set.filter(
|
|
|
|
|
|
|
|
state__in=[
|
|
|
|
|
|
|
|
ShiftRegistration.RegState.REGISTERED,
|
|
|
|
|
|
|
|
ShiftRegistration.RegState.CHECKED_IN,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Helper(models.Model):
|
|
|
|
class Helper(models.Model):
|
|
|
|
phone = PhoneNumberField(unique=True, editable=False)
|
|
|
|
phone = PhoneNumberField(unique=True, editable=False)
|
|
|
|