|
|
@ -26,13 +26,13 @@ class Room(models.Model):
|
|
|
|
|
|
|
|
|
|
|
|
class Shift(models.Model):
|
|
|
|
class Shift(models.Model):
|
|
|
|
room = models.ForeignKey(Room, on_delete=models.RESTRICT)
|
|
|
|
room = models.ForeignKey(Room, on_delete=models.RESTRICT)
|
|
|
|
start_at = models.DateTimeField()
|
|
|
|
start_at = models.DateTimeField(db_index=True)
|
|
|
|
duration = models.DurationField()
|
|
|
|
duration = models.DurationField()
|
|
|
|
required_helpers = models.IntegerField(
|
|
|
|
required_helpers = models.IntegerField(
|
|
|
|
default=0, help_text="When this is set to zero, the room value is used instead."
|
|
|
|
default=0, help_text="When this is set to zero, the room value is used instead."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
description = models.TextField(blank=True, default="")
|
|
|
|
description = models.TextField(blank=True, default="")
|
|
|
|
deleted = models.BooleanField(default=False)
|
|
|
|
deleted = models.BooleanField(default=False, db_index=True)
|
|
|
|
|
|
|
|
|
|
|
|
def with_reg_count():
|
|
|
|
def with_reg_count():
|
|
|
|
return Shift.objects.annotate(
|
|
|
|
return Shift.objects.annotate(
|
|
|
|