Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

summation django queryset

from django.db.models import Sum

ItemPrice.objects.aggregate(Sum('price'))
# returns {'price__sum': 1000} for example
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #summation #django #queryset
ADD COMMENT
Topic
Name
7+7 =