2👍
✅
i resolved
https://github.com/rg3915/vendas/commit/cb8230ee52f10d917305f87f33bc749fd120afbb
Thanks.
def get_total(self):
s = self.sales_det.aggregate(
subtotal_sum=models.Sum('subtotal')).get('subtotal_sum') or 0
return s
0👍
You need to get subtotal in your view code, then pass it to the template as a context variable
- [Answered ]-Django 1.8 migration weirdness
- [Answered ]-Django kept previous data in database
- [Answered ]-Getting started with Django on Virtualbox>Vagrant>Ubuntu. Can't run django-admin
- [Answered ]-How to make sure that the UTC date saved in the database is equivalent to midnight in the specified timezone in Django
- [Answered ]-Django, many duplicated queries in my TabularInline
Source:stackexchange.com