Skip to content
Snippets Groups Projects
Verified Commit ab67e67e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Qualify field names for aggregation.

parent 0a33cbb2
No related branches found
No related tags found
No related merge requests found
...@@ -126,9 +126,18 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse ...@@ -126,9 +126,18 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse
).prefetch_related( ).prefetch_related(
'personal_notes' 'personal_notes'
).annotate( ).annotate(
absences=Count('personal_notes__absent', filter=Q(week=wanted_week, absent=True)), absences=Count('personal_notes__absent', filter=Q(
unexcused=Count('personal_notes__absent', filter=Q(week=wanted_week, absent=True, excused=False)), personal_notes__week=wanted_week,
tardiness=Sum('personal_notes__tardiness', filter=Q(week=wanted_week)) personal_notes__absent=True
)),
unexcused=Count('personal_notes__absent', filter=Q(
personal_notes__week=wanted_week,
personal_notes__absent=True,
personal_notes__excused=False
)),
tardiness=Sum('personal_notes__tardiness', filter=Q(
personal_notes__week=wanted_week
))
) )
else: else:
lesson_periods = None lesson_periods = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment