[Answer]-Django averages – average number of events per weekday

1👍

django’s aggregation queries could help, perhaps something like (untested):

from django.db.models import Avg
WEEKDAYS = ('monday', 'tuesday', 'wednesday', 'thursday', 'friday')
EventForDay.objects.filter(day_of_week__in=WEEKDAYS).annotate(Avg('day_of_week'))

Leave a comment