Skip to content

Commit

Permalink
Adding number of organizers retained
Browse files Browse the repository at this point in the history
  • Loading branch information
Ederporto committed Nov 9, 2023
1 parent 716eeb8 commit 38d4beb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions metrics/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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,
}
Expand Down

0 comments on commit 38d4beb

Please sign in to comment.