summation django queryset

268

summation django queryset -

from django.db.models import Sum

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

Comments

Submit
0 Comments