dahlia / sqlalchemy-imageattach

SQLAlchemy extension for attaching images to entities.
https://sqlalchemy-imageattach.readthedocs.io/
MIT License
116 stars 25 forks source link

Incompatible with sqlalchemy 1.4.x #47

Open mweinelt opened 3 years ago

mweinelt commented 3 years ago

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

CTHRU commented 1 year ago

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
placese commented 1 year ago

@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