I've been stuck on this for a couple hours now, it seems that whatever I put into my for loop in my index for html doesn't print at all? Thoughts?
index method:
def index():
portfolio = db.execute("SELECT * FROM portfolio WHERE user_id = :user_id", user_id = session["user_id"])
for row in portfolio:
symbol = row["symbol"]
share = row["shares"]
return render_template("index.html")
index.html:
{% extends "layout.html" %}
{% block title %}
Index
{% endblock %}
{% block main %}
<table>
<tr>
<th>
Symbol
</th>
<th>
Name
</th>
<th>
Shares
</th>
<th>
Price
</th>
<th>
Total
</th>
</tr>
{% for row in portfolio %}
<tr>
<td>
{{row.symbol}}
</td>
<td>
{{row.name}}
</td>
<td>
{{row.shares}}
</td>
<td>
{{row.price}}
</td>
<td>
{{row.total}}
</td>
</tr>
{% endfor %}
</table>
{% endblock %}