嗨我有一次使用多个表单的问题,尝试使用名称中的循环计数但是当我检查正确的选项然后提交我有这个错误
浏览器(或代理)发送了此服务器无法发出的请求 理解。
{%for tournament in tournament_querry%}
<div class="body-main">
<div class ="body-select">
<form action="", method="POST">
<input type="radio" name="option" value="{{tournament.player_one}}"> {{tournament.player_one}}<br>
</form>
</div>
<div class ="body-selected">
<form action="", method="POST">
<input type="radio" name="option" value="{{tournament.player_two}}"> {{tournament.player_two}}<br>
</div>
<input type="submit" value="Submit">
</form>
</div>
{%endfor%}
我的烧瓶路线=
@app.route("/news", methods=['POST', 'GET'])
@login_required
def news():
tournament_querry = Walka.query.join(Walka.Tournament).filter_by(name = 'Das').all()
if request.method == "POST":
option = request.form['options']
return option
return render_template("news.html", tournament_querry = tournament_querry)
我想从每个人那里获得价值,但我不知道如何获得它