diff options
author | Alban Gruin | 2017-11-25 15:14:52 +0100 |
---|---|---|
committer | Alban Gruin | 2017-11-25 15:14:52 +0100 |
commit | f333d363a78821ebab78fb9bb900d7aefbf6079c (patch) | |
tree | 4f0964afa138271429ad3f9dd8a2340c77236494 /models.py | |
parent | cbab00f4b745f4d80dd06a52699006d1d081be20 (diff) |
Dans get_weeks(), l’annotation Count() ne sert à rien.
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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): |