Django是支持aggregation的,可以如下对price求和:from django.db.models import Sumret = Product.objects.filter(id__in=plist).aggregate(Sum('price'))