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