My question is the following. I am starting my studies in django and encounter a problem. I have a function in my view with the following excerpt
def saldo_total(request):
receitas = Receitas.objects.aggregate(Sum('valor'))
total_receitas = receitas['valor__sum']
despesas = Despesas.objects.aggregate(Sum('valor'))
total_despesas = despesas['valor__sum']
receitas = receitas['valor__sum']
despesas = despesas['valor__sum']
total = total_receitas - total_despesas
return render(request, 'financas/saldo_total.html', {'total': total}, {'receitas': receitas}, {'despesas': despesas})
It does a db search by adding the sum of the revenue and expenses, and also below, subtract one by the other to inform the available balance of the user.
However, rendering only allows me to throw an attribute to return and I would like all three to be returned.
Is there any way to do this in django?