Skip to content
Snippets Groups Projects

Improve handling of child/parent groups

Merged Jonathan Weth requested to merge bugfix/handling-child-parent-groups into master
All threads resolved!
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
@@ -130,7 +130,7 @@ class LessonDataQuerySet(models.QuerySet):
if isinstance(group, int):
group = Group.objects.get(pk=group)
if group.parent_groups:
if group.parent_groups.all():
# Prevent to show lessons multiple times
return self.filter(Q(**{self._period_path + "lesson__groups": group}))
else:
@@ -450,7 +450,7 @@ class Lesson(ExtensibleModel):
return CalendarWeek(year=year, week=week)
class Meta:
ordering = ["date_start"]
ordering = ["date_start", "subject"]
indexes = [models.Index(fields=["date_start", "date_end"])]
@@ -559,7 +559,7 @@ class LessonPeriod(ExtensibleModel):
)
class Meta:
ordering = ["lesson__date_start", "period__weekday", "period__period"]
ordering = ["lesson__date_start", "period__weekday", "period__period", "lesson__subject"]
indexes = [models.Index(fields=["lesson", "period"])]
Loading