title: Django - Display filtered sum of a field from a model on template
body: <p>I have a model (camisaEvento) that have a One To Many relationship with (quantidadeEvento). I want to display on the template the sum of a field in quantidadeEvento but only for the elements of a determined record on camisaEvento. </p>
  
  <p>On the view i have the following, which are passed to the template to a render_to_response:</p>
  
  <pre><code>camisasEvento = camisaEvento.objects.all()
  quantidadesEvento = quantidadeEvento.objects.all()
  </code></pre>
  
  <p>I'm making a table for each record of camisaEvento, and in the end i want it to have a cell that is the sum of a determined field on the quantidadeEvento but only for the current camisaEvento record on the for loop, so in the template i have the following:</p>
  
  <pre><code>{% for camisa_do_evento in camisasEvento %}
  &lt;table&gt;
      &lt;td&gt;...&lt;td&gt;
      &lt;td&gt;...&lt;td&gt;
      .
      .
      .
      &lt;td&gt;The sum should be in here&lt;/td&gt;
  &lt;table&gt;
  {% endfor %}
  </code></pre>
  
  <p>What is the best way to do this? I know this is probably simple, but i'm quite new to programming and Django.</p>
  
  <p>Thanks</p>