From 8ad4a03f9d6ab6d218ddcbe277ca3766f05f6d79 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sat, 20 Jan 2018 17:24:18 +0100 Subject: Légère optimisation de la page des groupes --- models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): -- cgit v1.2.1