I'm trying to output a conditional sum / aggregation via django in html. Though not sure what to put in my template?
see below :
in views.py: (part of my code )
total_paid = CF.objects.filter(type='Payment').aggregate(Sum('amount')
return render(request, 'budget/budget_detail.html', {'paid': total_paid })
in budget/budget.html :
{{ paid }}
output is as follows in my browser : {'amount__sum': Decimal('-1500')}
can anyone help me? thanks !!