Skip to content

Commit

Permalink
Added support for bind parameter to session.
Browse files Browse the repository at this point in the history
This fixes pallets-eco#113
  • Loading branch information
mitsuhiko committed Jul 31, 2013
1 parent 575fa65 commit 0df8cae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -15,6 +15,8 @@ Version 2.0
- Added a way to control how signals for model modifications are tracked.
- Made the ``SignallingSession`` a public interface and added a hook
for customizing session creation.
- If the ``bind`` parameter is given to the signalling session it will no
longer cause an error that a parameter is given twice.

Version 1.0
-----------
Expand Down
3 changes: 2 additions & 1 deletion flask_sqlalchemy/__init__.py
Expand Up @@ -154,8 +154,9 @@ def __init__(self, db, autocommit=False, autoflush=False, **options):
#: key.
self.emit_modification_signals = \
self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']
bind = options.pop('bind', None) or db.engine
SessionBase.__init__(self, autocommit=autocommit, autoflush=autoflush,
bind=db.engine,
bind=bind,
binds=db.get_binds(self.app), **options)

def get_bind(self, mapper, clause=None):
Expand Down

0 comments on commit 0df8cae

Please sign in to comment.