Skip to content

Commit 4c48fe4

Browse files
authored
Merge pull request pallets-eco#761 from matanw/comment_init_app
add comment about db.init_app
2 parents 419fa5e + 23d69df commit 4c48fe4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flask_sqlalchemy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,9 @@ def init_app(self, app):
810810
of an application not initialized that way or connections will
811811
leak.
812812
"""
813+
# We intentionally don't set self.app = app, to support multiple
814+
# applications. If the app is passed in the constructor,
815+
# we set it and don't support multiple applications.
813816
if (
814817
'SQLALCHEMY_DATABASE_URI' not in app.config and
815818
'SQLALCHEMY_BINDS' not in app.config

0 commit comments

Comments
 (0)