diff options
author | jonathan vanasco <jonathan@2xlp.com> | 2015-04-02 15:21:21 -0400 |
---|---|---|
committer | jonathan vanasco <jonathan@2xlp.com> | 2015-04-02 15:21:21 -0400 |
commit | a0612a4d345019ea603a4d0bccb4ddcab3848af6 (patch) | |
tree | 10240b6fcbe456d9e0e106e3a78788c74bb0821b | |
parent | 47e775be2bf0da77be1b9cf4b7b2eb8ebad50054 (diff) | |
download | sqlalchemy-a0612a4d345019ea603a4d0bccb4ddcab3848af6.tar.gz |
updated sphinx tageting
-rw-r--r-- | lib/sqlalchemy/orm/scoping.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/scoping.py b/lib/sqlalchemy/orm/scoping.py index 9c6166af3..176523c3b 100644 --- a/lib/sqlalchemy/orm/scoping.py +++ b/lib/sqlalchemy/orm/scoping.py @@ -21,6 +21,12 @@ class scoped_session(object): """ + session_factory = None + """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.""" + def __init__(self, session_factory, scopefunc=None): """Construct a new :class:`.scoped_session`. @@ -38,10 +44,6 @@ 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) @@ -50,12 +52,12 @@ class scoped_session(object): def __call__(self, **kw): """Return the current :class:`.Session`, creating it - using the :class:`.session_factory` if not present. + using the :attr:`.scoped_session.session_factory` if not present. :param \**kw: Keyword arguments will be passed to the - :class:`.session_factory` callable, if an existing :class:`.Session` - is not present. If the :class:`.Session` is present and - keyword arguments have been passed, + :attr:`.scoped_session.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. """ |