aggregation with f 28 29 in django rest api

Solutions on MaxInterview for aggregation with f 28 29 in django rest api by the best coders in the world

showing results for - "aggregation with f 28 29 in django rest api"
Giorgio
17 Jul 2020
1>>> from django.db.models import Avg, Count
2>>> Book.objects.annotate(num_authors=Count('authors')).aggregate(Avg('num_authors'))
3{'num_authors__avg': 1.66}
4
similar questions