需要运行出以下图片中的表格形态
以下是原先的代码
python
Html模块
<h1 align="center">学生成绩表</h1>
<table border="1" align="center">
<tr bgcolor="red"><td>姓名</td> <td>成绩</td><td>总评</td></tr>
{% for i in user %}
<tr>
<td>{{i.username}}</td>
<td>{{i.socre}}</td>
<td>
{% if i.socre >= 90 and i.socre <= 100 %}
优秀
{% elif i.socre >= 60 and i.socre < 90 %}
及格
{% else %}
不及格
{% endif %}
</td>
</tr>
{% endfor %}
</table>
model的结构必须和实际数据库中表的结构相匹配。
在路由里,model会被实例化然后返回给前端。然后前端再显示。
所以首先要确定你定义了准确的model,然后再确定你返回给前端了正确的数据,最后是前端是否正确接收了数据。