Hello I have a question about the result of a query.
suma = Contrato.objects.aggregate(Sum('lote__Costo'))
The result is the sum of all the records in a column of the database.
What I can not understand exactly is the way in which I get the result of the query which is shown as follows
{'lote__Costo__sum': Decimal('142000.00')}
Is equal in the shell as in the template I wonder if there is a way to display only the result of the query.
Thanks.
To get the value you can do
and then pass the value(decimal_val) to template