Skip to content
Snippets Groups Projects
Verified Commit 528ed6ef authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add missing fields for LessonSubstitution

cancelled_for_teachers, comment
parent 489fe69f
No related branches found
No related tags found
1 merge request!39Resolve "Models for advanced features from SchoolApps (imported from Untis)"
...@@ -178,4 +178,19 @@ class Migration(migrations.Migration): ...@@ -178,4 +178,19 @@ class Migration(migrations.Migration):
model_name='absence', model_name='absence',
index=models.Index(fields=['date_start', 'date_end'], name='chronos_abs_date_st_337ff5_idx'), index=models.Index(fields=['date_start', 'date_end'], name='chronos_abs_date_st_337ff5_idx'),
), ),
migrations.AddField(
model_name='lessonsubstitution',
name='cancelled_for_teachers',
field=models.BooleanField(default=False, verbose_name='Cancelled for teachers?'),
),
migrations.AddField(
model_name='lessonsubstitution',
name='comment',
field=models.TextField(blank=True, null=True, verbose_name='Comment'),
),
migrations.AlterField(
model_name='lessonsubstitution',
name='cancelled',
field=models.BooleanField(default=False, verbose_name='Cancelled?'),
),
] ]
...@@ -467,7 +467,10 @@ class LessonSubstitution(models.Model): ...@@ -467,7 +467,10 @@ class LessonSubstitution(models.Model):
) )
room = models.ForeignKey("Room", models.CASCADE, null=True, blank=True, verbose_name=_("Room")) room = models.ForeignKey("Room", models.CASCADE, null=True, blank=True, verbose_name=_("Room"))
cancelled = models.BooleanField(default=False) cancelled = models.BooleanField(default=False, verbose_name=_("Cancelled?"))
cancelled_for_teachers = models.BooleanField(default=False, verbose_name=_("Cancelled for teachers?"))
comment = models.TextField(verbose_name=_("Comment"), blank=True, null=True)
def clean(self) -> None: def clean(self) -> None:
if self.subject and self.cancelled: if self.subject and self.cancelled:
...@@ -667,6 +670,6 @@ class Event(ExtensibleModel): ...@@ -667,6 +670,6 @@ class Event(ExtensibleModel):
class Meta: class Meta:
ordering = ["date_start"] ordering = ["date_start"]
indexes = [models.Index(fields=["periodfrom", "periodto", "date_start", "date_end"])] indexes = [models.Index(fields=["period_from", "period_to", "date_start", "date_end"])]
verbose_name = _("Event") verbose_name = _("Event")
verbose_name = _("Events") verbose_name = _("Events")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment