📅  最后修改于: 2022-03-11 14:45:46.437000             🧑  作者: Mango
>>> from django.db.models import Avg, Count
>>> Book.objects.annotate(num_authors=Count('authors')).aggregate(Avg('num_authors'))
{'num_authors__avg': 1.66}