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