aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'models.py')
-rw-r--r--models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/models.py b/models.py
index 9cb3bca..aa1cd3f 100644
--- a/models.py
+++ b/models.py
@@ -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")