diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2,6 +2,8 @@ from django.db import models from django.db.models import Q from django.utils.text import slugify +from .db import GroupedManager + import hashlib import os @@ -107,7 +109,7 @@ class Room(models.Model): verbose_name_plural = "salles" -class CourseManager(models.Manager): +class CourseManager(GroupedManager): 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, **filters).order_by("begin") |