我是新来的烧瓶-py2neo-pyhon-neo4j,所以我需要一些帮助
我有以下问题。运行/执行的main.py是视图.py我有另一个py脚本,其中我有一些表单的提交_data.html>;说得更清楚些
视图.py--呼叫-->;应用程序副本--调用-->窗体_动作.html&窗体(amp;F)_提交.html
我怎样才能实现这个序列??
烧瓶python代码:视图.py在@app.route('/vital', methods=['GET','POST'])
def vital():
# username = session.get('username')
name=request.form['pname']
sfx=request.form['psfx']
midname=request.form['pmidname']
bsurname=request.form['pbsurname']
# if not name:
# flash('You must give your post a name.')
# elif not sfx:
# flash('You must give your post a suffix.')
# elif not midname:
# flash('You must give your post a midname.')
# elif not bsurname:
# flash('You must give your post a bsurname.')
# else:
# User(session['username']).vital(name, sfx, midname, bsurname)
return render_template('form_action.html', username=username, sfx=sfx, midname=midname, bsurname=bsurname)
在应用程序副本在
^{pr2}$
形式_动作.html在
PersonPerson's Vital Information
Tell us about {{name}} {{bsurname}}!
Flask code
@app.route('/hello/', methods=['POST'])
def hello():
name=request.form['pname']
sfx=request.form['psfx']
midname=request.form['pmidname']
bsurname=request.form['pbsurname']
return render_template('form_action.html', name=name, sfx=sfx, midname=midname, bsurname=bsurname)