aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'models.py')
-rw-r--r--models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/models.py b/models.py
index 64fb675..26bb63d 100644
--- a/models.py
+++ b/models.py
@@ -4,6 +4,8 @@ from django.db.models.expressions import RawSQL
from django.db.models.functions import Extract, ExtractYear
from django.utils.text import slugify
+from .db import GroupedManager
+
import hashlib
import os
@@ -111,7 +113,7 @@ class Room(models.Model):
verbose_name_plural = "salles"
-class CourseManager(models.Manager):
+class CourseManager(GroupedManager):
def __get_weeks(self, qs):
extractYear = ExtractYear("begin")
@@ -130,6 +132,7 @@ class CourseManager(models.Manager):
qs = self.get_courses_for_group(group, **filters)
return self.__get_weeks(qs)
+
class Course(models.Model):
objects = CourseManager()