flask渲染模板时报错TypeError: 'UnboundField' object is not callable

渲染模板时,访问页面提示TypeError: 'UnboundField' object is not callable

flask渲染模板时报错TypeError: 'UnboundField' object is not callable

检查代码,发现实例化表单类是,没有加括号:form = NewNoteForm,加了括号后就解决了form = NewNoteForm()

@app.route('/index')
def index():
form = NewNoteForm
notes = Note.query.all()
return render_template('index.html', notes=notes, form=form)

flask渲染模板时报错TypeError: 'UnboundField' object is not callable

上一篇:[CB]2018全球半导体营收4700亿美元 三星继续碾压英特尔


下一篇:MySQL学习6 - 完整性约束