1
Here’s my loop (in my.html template):
{% for item in filter.qs %}
<tr>
<th scope="row">{{ item.id }}</th>
<td>{{ item.nome }}</td>
<td>{{ item.data|date:"d, F" }}</td>
<td>{{ item.tipo_pgto}}</td>
<td>{{ item.mes }}</td>
<td>{{ item.entrada }}</td>
<td>{{ item.valor}}</td>
</tr>
{% endfor %}
The variable {{ item.value }} contains a decimal value. How can I sum them (since it’s a loop) and put the result elsewhere in my html document? It would be better to use Javascript or have some way to make a logic within the view.py and create a temporary storage variable and use it in the template.py?