【发布时间】:2018-11-20 15:32:15
【问题描述】:
我的 models.py 文件中有这个类:
class DepartmentCategory(Enum):
"""The various categories of departments"""
committee = 'Committee'
subcommittee = 'Subcommittee'
在我的表单的选择字段中使用。一切正常,但是当我向 Enum 类添加一个新值时,例如:
class DepartmentCategory(Enum):
"""The various categories of departments"""
general = 'General'
committee = 'Committee'
subcommittee = 'Subcommittee'
保存新值数据库失败并且在终端和浏览器中都没有显示错误。我已经多次迁移(flask db migrate)和升级(flask db upgrade)我的数据库,但问题没有解决。请帮忙。
【问题讨论】:
标签: python mysql enums sqlalchemy