sqlalchemy flask: AttributeError: 'Session' object has no attribute '_model_changes' on session.commit()

后端 未结 2 1186
鱼传尺愫
鱼传尺愫 2020-12-31 03:40

I\'ve seen a lot of problems with SessionMaker, but this one is slightly different. Not sure why, but sqlalchemy won\'t let my session object commit.

In my app, I h

2条回答
  •  生来不讨喜
    2020-12-31 04:24

    I had the same problem as well, and solved it by modifying the _SessionSignalEvents class within init.py in flask-sqlalchemy. However, I just noticed that such a fix had already been in place since 8 months on the official repository.

    If you encounter a similar problem, I would recomment you to pull the latest version of the project off github (https://github.com/mitsuhiko/flask-sqlalchemy/) since the one currently available through pip install is outdated.

提交回复
热议问题