6
在烧瓶SQLAlchemy,它在:瓶SQLAlchemy的设置expire_on_commit =假
https://pythonhosted.org/Flask-SQLAlchemy/queries.html
您通过db.session
访问到您的会话。
让你通过db.session
访问会话如何有
expire_on_commit=False
我试图db.session.expire_on_commit = False
但这并不appera生效。
您需要使用'SQLALCHEMY_EXPIRE_ON_COMMIT'将它添加到应用程序设置中,但我必须问,为什么要这样做?您期望它做什么? –