diff --git a/membershipworks/models.py b/membershipworks/models.py index 88b95c1..180ed1b 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -4,7 +4,15 @@ from datetime import datetime import django.core.mail.message from django.conf import settings from django.db import models -from django.db.models import Exists, ExpressionWrapper, F, OuterRef, Subquery, Sum +from django.db.models import ( + Count, + Exists, + ExpressionWrapper, + F, + OuterRef, + Subquery, + Sum, +) from django.utils import timezone @@ -419,6 +427,7 @@ class EventExtManager(models.Manager["EventExt"]): super() .get_queryset() .annotate( + Count("meeting_times"), duration=Subquery( EventMeetingTime.objects.filter(event=OuterRef("pk")) .values("event__pk") diff --git a/membershipworks/templates/membershipworks/event_month_report.dj.html b/membershipworks/templates/membershipworks/event_month_report.dj.html index 9f1039c..31abe76 100644 --- a/membershipworks/templates/membershipworks/event_month_report.dj.html +++ b/membershipworks/templates/membershipworks/event_month_report.dj.html @@ -35,7 +35,7 @@