From 38d4bebfd3f0b0543e389cff475adbb45175d935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Porto?= Date: Thu, 9 Nov 2023 16:21:08 -0300 Subject: [PATCH] Adding number of organizers retained --- metrics/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metrics/views.py b/metrics/views.py index 821e46e..1dbde94 100644 --- a/metrics/views.py +++ b/metrics/views.py @@ -94,6 +94,7 @@ def get_metrics_and_aggregate_per_project(): "Number of new editors": metric.number_of_new_editors, "Number of partnerships": metric.number_of_partnerships, "Number of organizers": metric.number_of_organizers, + "Number of organizers retained": metric.number_of_organizers_retained, "Number of people reached through social media": metric.number_of_people_reached_through_social_media, "Occurence": metric.boolean_type, } @@ -120,6 +121,7 @@ def get_metrics_and_aggregate_per_project(): "Number of new editors": Editor.objects.filter(editors__in=reports, account_creation_date__gte=F('editors__initial_date')).count() or 0, "Number of partnerships": Partner.objects.filter(partners__in=reports).distinct().count() or 0, "Number of organizers": Organizer.objects.filter(organizers__in=reports).distinct().count() or 0, + "Number of organizers retained": Organizer.objects.filter(retained=True, organizers__in=reports).distinct().count() or 0, "Number of people reached through social media": reports.aggregate(total=Sum(F("number_of_people_reached_through_social_media")))["total"] or 0, "Occurence": reports.filter(metrics_related__boolean_type=True).exists() or False, }