Merge "Add use_slave DB api support"

This commit is contained in:
Jenkins 2015-06-02 00:32:37 +00:00 committed by Gerrit Code Review
commit 25bcbfdbd4

View File

@ -46,11 +46,12 @@ def dispose():
get_engine().pool.dispose()
def get_session(autocommit=True, expire_on_commit=False):
def get_session(autocommit=True, expire_on_commit=False, use_slave=False):
"""Helper method to grab session."""
facade = _create_facade_lazily()
return facade.get_session(autocommit=autocommit,
expire_on_commit=expire_on_commit)
expire_on_commit=expire_on_commit,
use_slave=use_slave)
@contextlib.contextmanager