summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonathan vanasco <jonathan@2xlp.com>2015-04-02 14:46:40 -0400
committerjonathan vanasco <jonathan@2xlp.com>2015-04-02 14:46:40 -0400
commit47e775be2bf0da77be1b9cf4b7b2eb8ebad50054 (patch)
treeaffe4b34df1e648c6ab4f1453e590a9528b14b84
parent6de3d490a2adb0fff43f98e15a53407b46668b61 (diff)
downloadsqlalchemy-47e775be2bf0da77be1b9cf4b7b2eb8ebad50054.tar.gz
updates to scoping docs to make `.session_factory` appear public
-rw-r--r--lib/sqlalchemy/orm/scoping.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py
index b3f2fa5db..9c6166af3 100644
--- a/lib/sqlalchemy/orm/scoping.py
+++ b/lib/sqlalchemy/orm/scoping.py
@@ -38,6 +38,11 @@ class scoped_session(object):
"""
self.session_factory = session_factory
+ """The `session_factory` provided to `__init__` is stored in this
+ attribute and may be accessed at a later time. This can be useful when
+ a new non-scoped :class:`.Session` or :class:`.Connection` to the
+ database is needed."""
+
if scopefunc:
self.registry = ScopedRegistry(session_factory, scopefunc)
else:
@@ -45,10 +50,10 @@ class scoped_session(object):
def __call__(self, **kw):
"""Return the current :class:`.Session`, creating it
- using the session factory if not present.
+ using the :class:`.session_factory` if not present.
:param \**kw: Keyword arguments will be passed to the
- session factory callable, if an existing :class:`.Session`
+ :class:`.session_factory` callable, if an existing :class:`.Session`
is not present. If the :class:`.Session` is present and
keyword arguments have been passed,
:exc:`~sqlalchemy.exc.InvalidRequestError` is raised.