I have a list of values paid and want to display the total paid. I have used aggregation and Sum
to calculate the values together. The problem is,I just want the total value printed out, but aggregation prints out: {'amount__sum': 480.0}
(480.0 being the total value added.
In my View, I have:
from django.db.models import Sum
total_paid = Payment.objects.all.aggregate(Sum('amount'))
And to show the value on the page, I have a mako template with the following:
<p><strong>Total Paid:</strong> ${total_paid}</p>
How would I get it to show 480.0
instead of {'amount__sum': 480.0}
?