📜  summation django queryset - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:22.195000             🧑  作者: Mango

代码示例1
from django.db.models import Sum

ItemPrice.objects.aggregate(Sum('price'))
# returns {'price__sum': 1000} for example