forked from platypush/platypush
Fabio Manganiello
d33d760361
Import `declarative_base` in a way that is compatible with any SQLAlchemy version between 1.3 and 2.x.
10 lines
259 B
Python
10 lines
259 B
Python
from sqlalchemy import __version__
|
|
|
|
sa_version = tuple(map(int, __version__.split('.')))
|
|
|
|
if sa_version >= (1, 4, 0):
|
|
from sqlalchemy.orm import declarative_base
|
|
else:
|
|
from sqlalchemy.ext.declarative import declarative_base
|
|
|
|
Base = declarative_base()
|