Skip to content

Commit 0a2af2f

Browse files
committed
undo the change to cli.py
1 parent 600deb4 commit 0a2af2f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/flask_sqlalchemy/cli.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@
55
from flask import current_app
66

77

8-
if t.TYPE_CHECKING:
9-
from .extension import SQLAlchemy as SQLAlchemy
10-
else:
11-
SQLAlchemy = t.Any
12-
13-
148
def add_models_to_shell() -> dict[str, t.Any]:
159
"""Registered with :meth:`~flask.Flask.shell_context_processor` if
1610
``add_models_to_shell`` is enabled. Adds the ``db`` instance and all model classes
1711
to ``flask shell``.
1812
"""
19-
db: SQLAlchemy = current_app.extensions["sqlalchemy"]
13+
db = current_app.extensions["sqlalchemy"]
2014
out = {m.class_.__name__: m.class_ for m in db.Model._sa_registry.mappers}
2115
out["db"] = db
2216
return out

0 commit comments

Comments
 (0)