sqlalchemy-imageattach icon indicating copy to clipboard operation
sqlalchemy-imageattach copied to clipboard

Incompatible with sqlalchemy 1.4.x

Open mweinelt opened this issue 3 years ago • 2 comments

I see this test failure when running them against sqlalchemy 1.4.18:

sqlalchemy_imageattach/migration.py:5: in <module>
    from sqlalchemy.ext.declarative.api import DeclarativeMeta
E   ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.api'

https://docs.sqlalchemy.org/en/14/orm/extensions/declarative/api.html

mweinelt avatar Jun 20 '21 11:06 mweinelt

I came across your issue. Just wanted to let you know that I managed to use this library with SQLAlchemy 1.4 The test error is related to a wrong import in the store migration functionality, which you hopefully don't need. It can be solved by changing the import on line 5 of the migration.py file to:

from sqlalchemy.orm.decl_api import DeclarativeMeta

CTHRU avatar Oct 06 '22 17:10 CTHRU

@CTHRU Thank you for solution. I also needed to change line 60 in migration.py file to:

for cls in declarative_base.registry._class_registry.values()

sqlalchemy v 1.4.44

placese avatar Apr 06 '23 10:04 placese