运行model.py时报错:AttributeError: 'str' object has no attribute 'c'
来源:3-8 .管理员-登录日志-操作日志数据模型设计
精慕门0581346
2017-08-03
4回答
-
精慕门0581346
提问者
2017-08-04
多谢老师。我还想问一下,用flask不能前后端分开学吗,只能全栈吗。。
022017-08-04 -
精慕门0581346
提问者
2017-08-03
Traceback (most recent call last):
File "C:/Users/智汇谷东/PycharmProjects/movie_web/app/models.py", line 45, in <module>
class Tag(db.Model):
File "C:\Users\智汇谷东\movie\lib\site-packages\flask_sqlalchemy\__init__.py", line 602, in __init__
DeclarativeMeta.__init__(self, name, bases, d)
File "C:\Users\智汇谷东\movie\lib\site-packages\sqlalchemy\ext\declarative\api.py", line 64, in __init__
_as_declarative(cls, classname, cls.__dict__)
File "C:\Users\智汇谷东\movie\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 88, in _as_declarative
_MapperConfig.setup_mapping(cls, classname, dict_)
File "C:\Users\智汇谷东\movie\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 103, in setup_mapping
cfg_cls(cls_, classname, dict_)
File "C:\Users\智汇谷东\movie\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 131, in __init__
self._setup_table()
File "C:\Users\智汇谷东\movie\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 400, in _setup_table
if not table.c.contains_column(c):
AttributeError: 'str' object has no attribute 'c'Process finished with exit code 1
00 -
精慕门0581346
提问者
2017-08-03
这是models.py代码
012017-08-03 -
rustgopy
2017-08-03
亲,你好,你截取下models.py的代码!
00