I am trying to pass a row value of table for displaying in a new route if a user wants to see all full details of that row in a new page. row is a dictionary which I want to pass.this is one of many tds in a table created in maintable.html page
<td>
<a href="{{ url_for('details' , row = row )}}" class="btn btn-info""> View</a>
</td>
the route which I created and declared in my init.py is as follow :
@app.route("/details/<row>")
def details(row):
return render_template("details.html", row = row )
this is my details.html page
<!DOCTYPE html>
<html lang="en">
<head>
some other codes
</head>
<body>
<div class="container">
<div class="well">Website</div>
<p class="lead">
{{row.website}}
</p>
<div class="well">Title</div>
<p class="lead">
{{row.title}}
</p>
<div class="well">Organization</div>
<p class="lead">
{{ row.organization }}
</p>
<div class="well">Description</div>
<p class="lead">
{{ row.description }}
</p>
<div class="well">Close Date</div>
<p class="lead">
{{ row.close_date }}
</p>
<div class="well">Downlaods</div>
<p class="lead">
{{ row.close_date }}
{% for link in row.downloads %}
{% if link != '' %}
<a href="{{ link }}">[{{ loop.index }}]</a>
{% else %}
<p>N/A</p>
{% endif %}
{% endfor %}
</td>
</p>
</div>
</body>
</html>
when I click on the view button it gives me error as: Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
有人能帮我确定我的代码是否正确地传递了行,以及如何修复错误吗。 我正在努力学习,非常感谢你的帮助
目前没有回答
相关问题 更多 >
编程相关推荐