aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2018-01-20 17:24:18 +0100
committerAlban Gruin2018-01-21 19:42:55 +0100
commit8ad4a03f9d6ab6d218ddcbe277ca3766f05f6d79 (patch)
tree5ae1153b8e83dfd0d52528857982bad8ad98d316 /models.py
parent6f4822291d89dadcb6bae94c897e89e309218e7e (diff)
Légère optimisation de la page des groupes
Diffstat (limited to 'models.py')
-rw-r--r--models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/models.py b/models.py
index c122bfd..b809a53 100644
--- a/models.py
+++ b/models.py
@@ -200,7 +200,8 @@ class CourseManager(Manager):
.annotate(year=ExtractYear("begin"),
week=ExtractWeek("begin")) \
.values("groups__mention", "groups__semester",
- "groups__subgroup", "year", "week")
+ "groups__subgroup", "year", "week") \
+ .annotate(c=Count("*"))
class Course(models.Model):