title: Flask return SUM into Jinja2 list
body: <p>im using a combination of flask and Jinja to return a template.</p>
  
  <p>My SQL Statement is getting a list of "stocks" currently and looks like this:</p>
  
  <pre><code>stocks = db.execute("SELECT symbol,SUM(numshare),price FROM portfolio GROUP BY symbol")
  return render_template("index.html",stocks=stocks)
  </code></pre>
  
  <p>and my HTML (Basic right now, just making sure I understand it first):</p>
  
  <pre><code>    {% for stock in stocks %}
        &lt;p&gt;{{stock.symbol}},{{stock.sum}},{{stock.price}}&lt;/p&gt;
      {% endfor %}
  </code></pre>
  
  <p>So it's returning the symbol and price of course, but I need to return the SUM of the numshare (Which is the number of shares bought for each "Stock". So im compounding them just for easier readability.</p>
  
  <p>Is there a good way to do this? Keeping in my "table" might have multiples of the same stocks at different prices</p>