追記:月末
(python2.7, django1.4)
from django.db.models import Sum total_num = ModelName.objects.aggregate(Sum('somenum'))['somenum__sum']
牌語備忘録 -pygo
追記:月末
(python2.7, django1.4)
from django.db.models import Sum total_num = ModelName.objects.aggregate(Sum('somenum'))['somenum__sum']