flask渲染模板时报错TypeError: 'UnboundField' object is not callable
渲染模板时,访问页面提示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的更多相关文章
- 解决Flask和Django的错误“TypeError: 'bool' object is not callable”
跟着欢迎进入Flask大型教程项目!的教程学习Flask,到了重构用户模型的时候,运行脚本后报错: TypeError: 'bool' object is not callable 这是用户模型: c ...
- appium 提示报错“TypeError: 'unicode' object is not callable”的解决方式!
这里提到的这个报错,是小错误且容易经常会犯,有时需要特别注意使用. 目的要求结果:根据某个元素的id值获取到对应id的text值,并且将获取的text值与本身存在的text值做比较,查看text值是否 ...
- pip install 报错 TypeError: 'module' object is not callable
$ pip install filetype Traceback (most recent call last): File "/usr/local/bin/pip2", line ...
- python3 pip报错 TypeError: 'module' object is not callable
使用命令:python -m pip install xx即可,需要在pip前加python -m
- TypeError: 'str' object is not callable
Python报错TypeError: 'str' object is not callable
- python Flask :TypeError: 'dict' object is not callable
flask 基于Werkzeug .. @moudule.route('/upload', methods=['GET', 'POST']) def upload_file(): global _fl ...
- PHP json_decode object时报错Cannot use object of type stdClass as array
PHP json_decode object时报错Cannot use object of type stdClass as array php再调用json_decode从字符串对象生成json对象 ...
- PyCharm+selenium环境搭建报错:Traceback (most recent call last): TypeError: 'module' object is not callable
环境搭建好后,代码如下: from selenium import webdriverdriver = webdriver.chrome()driver.get("http://www.ba ...
- Ajax上传文件/照片时报错TypeError :Illegal invocation
问题 Ajax上传文件/照片时报错TypeError :Illegal invocation 解决 网上搜索问题,错误原因可能有以下几个,依次检查: 请求类型有误,如post请求,但在后台设置的是ge ...
随机推荐
- more 命令
[root@localhost ~]# .txt # 按页显示文件内容,能向下翻页查看
- php程序猿面试分享
面试总结 今天去了北京著名IT公司进行PHP程序猿的面试.这是人生第一次么,怎么不紧张?我是不是有病.不是.这叫自信呵. 首先是做一些笔试题. 1.mysql数据库索引使用的数据结构?这样做的优点是? ...
- 1 认识开源性能测试工具jmeter
典型的性能测试工具主要有2个,Load Runner和jmeter.Load Runner是商业化的,Jmeter是开源的.下面我们认识一下开源性能测试工具jmeter. 1.jmeter是什么? A ...
- 下载pywinauto
1.下载pywinauto 链接:http://pywinauto.github.io/ 2.将安装包放到D:python36\script,进入pywinauto目录,按shift+右键,进入命令窗 ...
- 单例模式多线程安全写法(double-lock-check)
原始版本 public static Object getInstance() { if (instance != null) { return instance; } instance = new ...
- Ext.create细节分析
var win1 = Ext.create('Ext.window.Window', { //实例化方法四 : 使用 完整的 Extjs 类名 width: 800, title: 'define t ...
- 学习笔记 python 面向对象学习
封装: 封装是面向对象的特征之一,是对象和类概念的主要特性. 封装,也就是把客观事物封装成抽象的类,并且类可以把自己的数据和方法只让可信的类或者对象操作,对不可信的进行信息隐藏. 继承: 继承是指这样 ...
- C++编译变更stlport到使用g++的stl经验总结
. 花了几天时间,需要把经验给记下来. 1. 需要支持C++11的编译器,最方便的方式就是 yum -y install devtoolset-6 在/usr/local/bin中增加gcc6.sh ...
- windows-spidermonkey
听过Mozilla(火狐浏览器的娘家)的javascript引擎吗?感兴趣吗?想在windows平台的应用开发中使用这个引擎吗? 肯定? 好,往下看! 本文给出Windows平台SpiderMonke ...
- python list成员函数extend与append的区别
extend 原文解释,是以list中元素形式加入到列表中 extend list by appending elements from the iterable append(obj) 是将整个ob ...