'NoneType' object has no attribute 'foreign_key_ddl'

泄露秘密 提交于 2019-12-09 18:40:23
  File "./watermark/models.py", line 103, in <module>
    class WaterMark(db.Model):
  File "./watermark/models.py", line 107, in WaterMark
    INTEGER(unsigned=True),
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/testing/schema.py", line 76, in Column
    if not config.requirements.foreign_key_ddl.enabled_for_config(config):
AttributeError: 'NoneType' object has no attribute 'foreign_key_ddl'
#  原始代码
from sqlalchemy.testing.schema import Column

    id = Column(
        INTEGER(unsigned=True),
        primary_key=True
    )

solve

from sqlalchemy import  Column
    id = Column(
        INTEGER(unsigned=True),
        primary_key=True
    )

  • 使用编辑器自动导包需要注意不要导错了
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!