mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Gestion des absences du jour [#16]
This commit is contained in:
@ -130,34 +130,4 @@ class PaymentMode(models.Model):
|
||||
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='payment_modes')
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.get_mode_display()} - {self.get_type_display()}"
|
||||
|
||||
class AbsenceMoment(models.IntegerChoices):
|
||||
MORNING = 1, 'Morning'
|
||||
AFTERNOON = 2, 'Afternoon'
|
||||
TOTAL = 3, 'Total'
|
||||
|
||||
class AbsenceReason(models.IntegerChoices):
|
||||
JUSTIFIED_ABSENCE = 1, 'Justified Absence'
|
||||
UNJUSTIFIED_ABSENCE = 2, 'Unjustified Absence'
|
||||
JUSTIFIED_LATE = 3, 'Justified Late'
|
||||
UNJUSTIFIED_LATE = 4, 'Unjustified Late'
|
||||
|
||||
class AbsenceManagement(models.Model):
|
||||
day = models.DateField()
|
||||
moment = models.IntegerField(
|
||||
choices=AbsenceMoment.choices,
|
||||
default=AbsenceMoment.TOTAL
|
||||
)
|
||||
reason = models.IntegerField(
|
||||
choices=AbsenceReason.choices,
|
||||
default=AbsenceReason.UNJUSTIFIED_ABSENCE
|
||||
)
|
||||
student = models.ForeignKey(
|
||||
'Subscriptions.Student',
|
||||
on_delete=models.CASCADE,
|
||||
related_name='absences'
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.student} - {self.day} - {self.get_moment_display()} - {self.get_reason_display()}"
|
||||
return f"{self.get_mode_display()} - {self.get_type_display()}"
|
||||
Reference in New Issue
Block a user