From 599b7f77854c62c94cb855ad0f4468a6f0a10342 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 22 Jan 2024 00:36:58 -0500 Subject: [PATCH] membershipworks: Use unique name for sum of count of EventExt.meeting_times --- membershipworks/models.py | 2 +- .../templates/membershipworks/event_index_report.dj.html | 2 +- .../templates/membershipworks/event_year_report.dj.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 8fc7dea..2eb0d64 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -433,7 +433,7 @@ class EventExtQuerySet(models.QuerySet["EventExt"]): return method( count__sum=Sum("count", filter=F("occurred")), instructor__count=Count("instructor", distinct=True, filter=F("occurred")), - meeting_times__count=Count("meeting_times__count", filter=F("occurred")), + meeting_times__count__sum=Sum("meeting_times__count", filter=F("occurred")), duration__sum=Sum("duration", filter=F("occurred")), person_hours__sum=Sum("person_hours", filter=F("occurred")), event_count=Count("eid", filter=F("occurred")), diff --git a/membershipworks/templates/membershipworks/event_index_report.dj.html b/membershipworks/templates/membershipworks/event_index_report.dj.html index 83276f1..547bc58 100644 --- a/membershipworks/templates/membershipworks/event_index_report.dj.html +++ b/membershipworks/templates/membershipworks/event_index_report.dj.html @@ -31,7 +31,7 @@ {{ year.canceled_event_count }} {{ year.count__sum }} {{ year.instructor__count }} - {{ year.meeting_times__count }} + {{ year.meeting_times__count__sum }} {{ year.duration__sum|duration_as_hours }} {{ year.person_hours__sum|duration_as_hours }} diff --git a/membershipworks/templates/membershipworks/event_year_report.dj.html b/membershipworks/templates/membershipworks/event_year_report.dj.html index d42f0b6..1f3fccb 100644 --- a/membershipworks/templates/membershipworks/event_year_report.dj.html +++ b/membershipworks/templates/membershipworks/event_year_report.dj.html @@ -32,7 +32,7 @@ {{ month.canceled_event_count }} {{ month.count__sum }} {{ month.instructor__count }} - {{ month.meeting_times__count }} + {{ month.meeting_times__count__sum }} {{ month.duration__sum|duration_as_hours }} {{ month.person_hours__sum|duration_as_hours }}