Skip to content

Commit

Permalink
Tweaks in import
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshit Gupta committed Aug 27, 2023
1 parent ccd7350 commit d5731c1
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions flask_appbuilder/models/sqla/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,9 @@
import logging
import re

try:
from flask_sqlalchemy import DefaultMeta, Model as FSQLAlchemyModel
except ImportError:
from flask_sqlalchemy.model import ( # noqa
DefaultMeta,
Model as FSQLAlchemyModel,
)
from flask_sqlalchemy.model import DefaultMeta, Model
from flask_sqlalchemy import SQLAlchemy


try:
from sqlalchemy.ext.declarative import as_declarative, declarative_base
except ImportError:
from sqlalchemy.ext.declarative.api import as_declarative # noqa

try:
from sqlalchemy.orm.util import identity_key # noqa

has_identity_key = True
except ImportError:
has_identity_key = False
from sqlalchemy.orm import declarative_base

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -66,7 +48,7 @@ def to_json(self):
return result


Model = declarative_base(cls=BaseModel, metaclass=ModelDeclarativeMeta, name="Model")
Model = declarative_base(cls=Base Model, metaclass=ModelDeclarativeMeta, name="Model")


class SQLA(SQLAlchemy):
Expand Down

0 comments on commit d5731c1

Please sign in to comment.