I’m trying to loop through objects from my database in the template and one of the things I want to display is the difference between two of the fields in the table. Is there a clean way to do this:
{% for game in games %}
<tr>
<td width=100><p>{{ game.name }} </p></td>
<td width=300><p>{{ game.campaign }} </p></td>
<td width=90><p>{{ game.num_Players }} </p></td>
<td width=90><p>{{ game.num_Players - game.accepted_Characters }}</p></td>
<td width=90><p>{{ game.standing_Requests }}</p></td>
</tr>
{% endfor %}
? Where game is a table object with all those fields.
Django templates are designed not to do computation. You should adjust your
gameslist in the view, then display it in the template: