Skip to content
Snippets Groups Projects

Unify API of lesson period with event and extra lesson by adding properties for group names

Merged Jonathan Weth requested to merge fix/unify-group-names-api into master
1 file
+ 10
0
Compare changes
  • Side-by-side
  • Inline
@@ -473,6 +473,16 @@ class LessonPeriod(WeekAnnotationMixin, TeacherPropertiesMixin, ExtensibleModel)
def get_groups(self) -> models.query.QuerySet:
return self.lesson.groups
@property
def group_names(self):
"""Get group names as joined string."""
return self.lesson.group_names
@property
def group_short_names(self):
"""Get group short names as joined string."""
return self.lesson.group_short_names
def __str__(self) -> str:
return f"{self.period}, {self.lesson}"
Loading