aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-11-25 15:14:52 +0100
committerAlban Gruin2017-11-25 15:14:52 +0100
commitf333d363a78821ebab78fb9bb900d7aefbf6079c (patch)
tree4f0964afa138271429ad3f9dd8a2340c77236494 /models.py
parentcbab00f4b745f4d80dd06a52699006d1d081be20 (diff)
Dans get_weeks(), l’annotation Count() ne sert à rien.
Diffstat (limited to 'models.py')
-rw-r--r--models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/models.py b/models.py
index 59301e0..cd19259 100644
--- a/models.py
+++ b/models.py
@@ -158,9 +158,10 @@ class CourseManager(Manager):
return self.get_queryset() \
.filter(**criteria) \
.order_by("groups__name", "year", "week") \
- .annotate(_=Count(("groups", "year", "week", "begin")),
- year=ExtractYear("begin"),
- week=ExtractWeek("begin"))
+ .annotate(year=ExtractYear("begin"),
+ week=ExtractWeek("begin")) \
+ .values("groups__mention",
+ "groups__subgroup", "year", "week")
class Course(models.Model):