mrevutskyi / flask-restless-ng

A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless-ng.readthedocs.io
Other
64 stars 11 forks source link

SQLAlchemy version requirement to low #22

Closed mosheduminer closed 3 years ago

mosheduminer commented 3 years ago

In helpers.py, DeclarativeMeta is imported as follows:

from sqlalchemy.orm import DeclarativeMeta

This import is correct only in sqlalchemy>=1.4, not in 1.3. However, the requirements for this project allow for 1.3 as well.

Given I am migrating an existing project that is currently using sqlalchemy 1.3, I request that the import be changed to:

try:
    from sqlalchemy.orm import DeclarativeMeta
except ImportError:
    from sqlalchemy.ext.declarative.api import DeclarativeMeta

But if not, please bump the sqlalchemy version in setup.py.

mrevutskyi commented 3 years ago

Thank you for reporting. Fixed the import. v2.0.2 has been published