Add All Columns In Django

[Solved] Add All Columns In Django | Python Frameworks Django - Code Explorer | www.yomemimo.com
Question : add all columns in django

Answered by : talented-teira-okrlfluyhzpw

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')
)

Source : https://stackoverflow.com/questions/67956302/django-get-the-sum-of-all-columns-for-a-particular-user | Last Update : Thu, 23 Jun 22

Answers related to add all columns in django

Code Explorer Popular Question For Python Frameworks Django