flask wtforms 中表单怎么改css

富国沪深
浏览 1593回答 1
1回答

长风秋雁

视图函数中传递若干个form实例到html页:@app.route('/test/')def test(): form1 = TestForm1() form2 = TestForm2() return remder_template('test.html',form1=form1,form2=form2)<form action="/test1/ method="post"> {{ form1.field() }} <input type="submit" value="提交" /></form> <form action="/test2/ method="post"> {{ form2.field() }} <input type="submit" value="提交" /></form>再编写两个视图函数分别接收form1,form2提交的数据:@app.route('/test1/', method=['POST'])def test1(): # 处理代码 @app.route('/test2/', method=['POST'])def test2(): # 处理代码
打开App,查看更多内容
随时随地看视频慕课网APP