或者有没有什么解决方案可以用url_for
href和a
html标签传递多个变量?
我的问题是,我不能用form获取input标签的数据,因为我使用了一个动态URL,它看起来像:
<a href="{{ url_for('polling', Qid=question.name, option=1) }}"> Vote </a>
我想在路由中使用input标签的数据:
@app.route('/polling/<Qid>/<option>')
def polling(Qid, option):
return redirect(url_for('results', Qid=Qid))
1条答案
按热度按时间8oomwypt1#
回答你的部分问题:
或者有没有什么解决方案可以用一个html标签和一个url_for href来传递多个变量?
是的,你可以将多个变量传递给
url_for
,没有任何问题:main.py
home.html