AttributeError: 'SQLAlchemy' object has no attribute 'Foreignkey'
在学习《Flask Web开发----基于Python的Web应用开发实战》的过程中,调试程序,如下图,运行报错:
AttributeError: 'SQLAlchemy' object has no attribute 'Foreignkey'

原因:是关键字Foreignkey里的字母k应该是大写,错写成小写字母了
解决办法,改成ForeignKey即可
role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))
AttributeError: 'SQLAlchemy' object has no attribute 'Foreignkey'的更多相关文章
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...
- AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'
/*************************************************************************** * AttributeError: 'modu ...
- AttributeError: 'dict_values' object has no attribute 'translate'
/***************************************************************************************** * Attribu ...
- python3 AttributeError: 'NoneType' object has no attribute 'split'
from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...
- 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法
版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...
- AttributeError: 'module' object has no attribute 'Thread'
$ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last): File "th ...
- 解决window7 x64位Anaconda启动报错:AttributeError: '_NamespacePath' object has no attribute 'sort'
最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下 ...
随机推荐
- Codeforces Round #340 (Div. 2) E XOR and Favorite Number 莫队板子
#include<bits/stdc++.h> using namespace std; <<; struct node{ int l,r; int id; }q[N]; in ...
- Qt代码区字符编码转换
在做通讯练习的时候,发现发送给小助手字符乱码,图片如下 本人Qt Creator是UTF-8,需要改成gbk,代码如下 #include<QTextCodec> // 提供字符编码转换 Q ...
- Neo4j入门-开始使用
前言 关系,指事物之间相互作用.相互影响的状态. 数据之间的关系也是如此,数据之间关系的存储在RDS就已经开始.从数据库支持的外键,到手动建立的关系表,人们采取了许多方法,只为了解决查询复杂.缓慢等问 ...
- 【Flutter】环境搭建以及HelloWorld创建
平台:WIndows10 Android Studio VScode同理,具体可以参考Flutter中文站 配置环境 1.下载SDK,进入官网选择最新的即可.我这里选择的是v1.9.1+hotfix. ...
- STL-list 链表
#include <iostream> #include <list> using namespace std; int main() { // list可以在头部和尾部插入和 ...
- [JAVA] 面向对象小小总结
面向对象概述 符合人类思维习惯的编程思想 , 生活中存在着不同形态的事物 , 这些事物存在着不同的联系 , 在程序中使用对象来映射现实中事物 , 使用对象关系来描述事物之间的联系, 这种思想就是面向对 ...
- java通过递归统计文件大小
思路就是通过文件的遍历,对一个文件夹中的非目录文件进行大小统计,并对其中目录文件进行相同的遍历操作,代码如下: package word; import java.io.File; import ja ...
- Android列表类视图之基本适配器BaseAdapter
说到列表视图,不难联想到前面提到过的数组适配器,但是数组适配器只能搭建文本选择项,扩展能力并不强,Android提供了一种适应性更强的基本适配器BaseAdapter,该适配器允许开发者在别的代码中进 ...
- Nginx模块之ngx_http_proxy_module
ngx_http_proxy_module模块: 示例: location / { proxy_pass http://localhost:8000; proxy_set_header Host $h ...
- 剑指offer-面试题16-数值的整数次方-数字
/* 题目: 实现函数double Power(double base,int exponent), 求base的exponent次方. */ /* 思路: 本题需要考虑的情况较多: 1.0的负数次方 ...