我在/ statistics / id。
我在烧瓶视图中有一个资源:
@app.route('/statistics2/<int:id>', methods=['GET', 'POST']):
quotation_title = db.get_quotation_by_session_parameter(id, 'number_questions')
return render_template('statistics2.html', quotation_title = quotation_title)
我想在我的对象html标签中调用此资源。
我这样做:
<object id="content" type="text/html" width="100%" height="100%" data="statistics" ></object>
在数据属性中,我想指出统计信息/ ID,但我不知道如何检索当前ID
例如:使用id 6,我在/ statistics / 6中,我想在数据属性statistics2 / 6中的对象html中显示。
我该怎么做?
感谢您的帮助。
答案 0 :(得分:0)
您可以从传递给模板的id
变量中获取quotation_title
。
像{{ quotation_title.id }}