📅  最后修改于: 2022-03-11 14:47:04.192000             🧑  作者: Mango
from django.db.models import Sum
result = Books.objects.values('author')
.order_by('author')
.annotate(total_price=Sum('price'))