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 ...
随机推荐
- ubuntu编译opencv3.1遇到的问题
网上有很多关于编译的具体步骤,我也是按照网上的说明一步步操作的,这里主要想记录的是在安装完之后,import cv2不存在以及其他的libopencv_hdf.so.3.1等找不到的问题,如果将这样的 ...
- Vue项目
1.新建Vue项目:vue init webpack projectName 2.vue-router模块 1.安装vue-router模块:npm install vue-router --save ...
- es修改指定的field(partial update)
PUT /index/type/id 创建文档&替换文档,就是一样的语法一般对应到应用程序中,每次的执行流程基本是这样的:1.应用程序发起一个get请求,获取到document,展示到前台界面 ...
- Could not autowire. No beans of 'TbItemMapper' type found. less... (Ctrl+F1) Checks autowiring prob
Intellij Idea开发工具在@Autowired或者@Resource注入XxxMapper接口时报如下错误: Could not autowire. No beans of 'TbItemM ...
- 10.1-uC/OS-III任务堆栈空间
1.设置任务优先级 嵌入式系统中的重要的应用应该被设置为高优先级,一些显示操作就应该被设置为低优先级. 然而, 由于实时系统的复杂性, 在大多数情况下任务的优先级是不能被事先确定的.多数系统中,不是所 ...
- 开发uniapp必备
开发工具http://quickapp.dcloud.io/ 开发手册 http://uniapp.dcloud.io/api/README(2018-7-27 发布) 调试环境http://ask. ...
- 让IIS6支持任意扩展名和未知扩展名的下载
IIS6的安全性提高了很多,为了防止扩展名欺骗带来的安全性问题,限制了扩展名MIME类型. IIS6 只为对具有已知文件扩展名的文件的请求提供服务.如果请求内容的文件扩展名未映射到已知的扩展,则服务器 ...
- 关于Go,你可能不注意的7件事
转自: https://tonybai.com/2015/09/17/7-things-you-may-not-pay-attation-to-in-go/ Go以简洁著称,但简洁中不乏值得玩味的小细 ...
- 网络编程——socket编程
一.客户端/服务端架构 1.硬件C/S架构(打印机) 2.软件C/S架构 互联网企业处处是C/S架构 C/S架构与socket的关系:学习socket就是为了完成C/S架构的开发 二.OSI七层 一个 ...
- vmware相关设置
vmware虚拟机和宿主机共享文件夹 点击“虚拟机”->“设置” 进入之后,选择“选项”选项卡->选择“共享文件夹”(此处已启用实在安装VMware Tools时选择了启用共享文件夹功能) ...