I'm in/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 中。
我该怎么做?
感谢您的帮助。
您可以从传递给模板quotation_title
变量中获取id
。
像这样{{ quotation_title.id }}