Skip to content
Snippets Groups Projects
Commit b3a9ed07 authored by Alban Gruin's avatar Alban Gruin
Browse files

Le sous-groupe peut être nul

parent df8f43e5
Branches
Tags v0.7.2
No related merge requests found
......@@ -133,7 +133,7 @@ class Meta:
class CourseManager(Manager):
def get_courses_for_group(self, group, **filters):
return self.get_queryset().filter(Q(groups__td__isnull=True) | Q(groups__td=group.td), Q(groups__tp__isnull=True) | Q(groups__tp=group.tp), groups__mention=group.mention, groups__subgroup=group.subgroup, timetable=group.timetable, **filters).order_by("begin")
return self.get_queryset().filter(Q(groups__td__isnull=True) | Q(groups__td=group.td), Q(groups__tp__isnull=True) | Q(groups__tp=group.tp), Q(groups__subgroup__isnull=True) | Q(groups__subgroup=group.subgroup), groups__mention=group.mention, timetable=group.timetable, **filters).order_by("begin")
def get_weeks(self, **criteria):
qs = self.get_queryset().filter(**criteria).order_by("groups__name", "year", "week").annotate(_=Count(("groups", "year", "week", "begin")), year=ExtractYear("begin"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment