add all columns in django

35

from decimal import Decimal
from django.db.models import Sum

ord=Order.objects.filter(added_by_id=1).aggregate(
    total_cash=Sum('current_ac'),
    total_balance=Sum('balance'),
    total_ac=Sum('current_ac')
)

Comments

Submit
0 Comments