Module ImportFrom alias identifier ImportFrom alias alias alias ImportFrom alias alias identifier ImportFrom alias Assign NameStore ListLoad Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad NameLoad NameLoad orelse Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If CompareIsNot NameLoad NameLoad body If Call AttributeLoad AttributeLoad NameLoad attr attr body Raise Call AttributeLoad NameLoad attr Str orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad orelse Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str If Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad If NameLoad body If NameLoad body Return Call NameLoad NameLoad keyword Call AttributeLoad NameLoad attr orelse Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad decorator_list decorator_list Return Call NameLoad decorator_list decorator_list Assign NameStore NameLoad Expr Str FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam defaults vararg kwarg body Return Call Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list For NameStore AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list Return Call NameLoad NameLoad NameLoad decorator_list For NameStore TupleLoad Str Str Str Str Str Str Str Str Str body Expr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad FunctionDef arguments args NameParam defaults body FunctionDef arguments args NameParam defaults vararg kwarg body Return Call Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list Return Call NameLoad NameLoad decorator_list For NameStore TupleLoad Str Str Str body Expr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad
N/A N/A exc sa_exc util ScopedRegistry ThreadLocalRegistry warn N/A class_mapper exc orm_exc session Session N/A __all__ N/A scoped_session scoped_session N/A object N/A N/A Provides scoped management of :class:`.Session` objects.

    See :ref:`unitofwork_contextual` for a tutorial.

     __init__ N/A N/A self session_factory scopefunc N/A None N/A N/A Construct a new :class:`.scoped_session`.

        :param session_factory: a factory to create new :class:`.Session`
         instances. This is usually, but not necessarily, an instance
         of :class:`.sessionmaker`.
        :param scopefunc: optional function which defines
         the current scope.   If not passed, the :class:`.scoped_session`
         object assumes "thread-local" scope, and will use
         a Python ``threading.local()`` in order to maintain the current
         :class:`.Session`.  If passed, the function should return
         a hashable token; this token will be used as the key in a
         dictionary in order to store and retrieve the current
         :class:`.Session`.

         N/A N/A self session_factory session_factory N/A scopefunc N/A N/A N/A self registry N/A ScopedRegistry session_factory scopefunc N/A N/A N/A self registry N/A ThreadLocalRegistry session_factory N/A __call__ N/A N/A self N/A kw N/A N/A Return the current :class:`.Session`, creating it
        using the session factory if not present.

        :param \**kw: Keyword arguments will be passed to the
         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.

         N/A kw N/A N/A scope N/A N/A kw pop scope False N/A N/A scope None N/A N/A N/A N/A N/A self registry has N/A N/A N/A N/A sa_exc InvalidRequestError Scoped session is already present; no new arguments may be specified. N/A N/A sess N/A N/A self session_factory kw N/A N/A N/A N/A self registry set sess N/A sess N/A N/A N/A N/A self session_factory kw N/A N/A N/A N/A self registry N/A remove N/A N/A self N/A N/A N/A Dispose of the current :class:`.Session`, if present.

        This will first call :meth:`.Session.close` method
        on the current :class:`.Session`, which releases any existing
        transactional/connection resources still being held; transactions
        specifically are rolled back.  The :class:`.Session` is then
        discarded.   Upon next usage within the same scope,
        the :class:`.scoped_session` will produce a new
        :class:`.Session` object.

         N/A N/A N/A N/A self registry has N/A N/A N/A N/A N/A N/A self registry close N/A N/A N/A N/A self registry clear N/A configure N/A N/A self N/A kwargs N/A N/A reconfigure the :class:`.sessionmaker` used by this
        :class:`.scoped_session`.

        See :meth:`.sessionmaker.configure`.

         N/A N/A N/A N/A self registry has N/A N/A N/A warn At least one scoped session is already present.  configure() can not affect sessions that have already been created. N/A N/A N/A N/A self session_factory configure kwargs N/A query_property N/A N/A self query_cls N/A None N/A N/A return a class property which produces a :class:`.Query` object
        against the class and the current :class:`.Session` when called.

        e.g.::

            Session = scoped_session(sessionmaker())

            class MyClass(object):
                query = Session.query_property()

            # after mappers are defined
            result = MyClass.query.filter(MyClass.name=='foo').all()

        Produces instances of the session's configured query class by
        default.  To override and use a custom implementation, provide
        a ``query_cls`` callable.  The callable will be invoked with
        the class's mapper as a positional argument and a session
        keyword argument.

        There is no limit to the number of query properties placed on
        a class.

         query N/A object N/A __get__ N/A N/A s instance owner N/A N/A N/A N/A N/A mapper N/A class_mapper owner N/A mapper N/A N/A query_cls N/A N/A N/A query_cls mapper session N/A N/A self registry N/A N/A N/A N/A N/A N/A self registry query mapper N/A N/A N/A N/A orm_exc UnmappedClassError N/A N/A None N/A N/A N/A N/A query N/A N/A N/A ScopedSession scoped_session N/A Old name for backwards compatibility. instrument N/A N/A name N/A N/A do N/A N/A self N/A args kwargs N/A N/A N/A N/A getattr N/A N/A self registry name args kwargs N/A N/A do N/A N/A meth N/A Session public_methods N/A N/A N/A setattr scoped_session meth N/A instrument meth makeprop N/A N/A name N/A N/A set N/A N/A self attr N/A N/A N/A N/A setattr N/A N/A self registry name attr N/A get N/A N/A self N/A N/A N/A N/A getattr N/A N/A self registry name N/A N/A N/A property get set N/A N/A prop N/A bind dirty deleted new identity_map is_active autoflush no_autoflush info N/A N/A N/A setattr scoped_session prop N/A makeprop prop clslevel N/A N/A name N/A N/A do N/A N/A cls N/A args kwargs N/A N/A N/A N/A getattr Session name args kwargs N/A N/A N/A classmethod do N/A N/A prop N/A close_all object_session identity_key N/A N/A N/A setattr scoped_session prop N/A clslevel prop