From: Mike Bayer Date: Sun, 19 Feb 2006 00:35:54 +0000 (+0000) Subject: some docstrings etc X-Git-Tag: rel_0_1_1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c8336870a85bffd2945ecd97627d5ed72b55cc9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git some docstrings etc --- diff --git a/doc/build/content/docstrings.myt b/doc/build/content/docstrings.myt index 8d0d3b6b33..67e6f8f2a8 100644 --- a/doc/build/content/docstrings.myt +++ b/doc/build/content/docstrings.myt @@ -7,6 +7,7 @@ import sqlalchemy.sql as sql import sqlalchemy.pool as pool import sqlalchemy.mapping as mapping + import sqlalchemy.exceptions as exceptions @@ -15,5 +16,7 @@ <& pydoc.myt:obj_doc, obj=sql, classes=[sql.Compiled, sql.ClauseElement, sql.TableImpl, sql.ColumnImpl] &> <& pydoc.myt:obj_doc, obj=pool, classes=[pool.DBProxy, pool.Pool, pool.QueuePool, pool.SingletonThreadPool] &> <& pydoc.myt:obj_doc, obj=mapping &> -<& pydoc.myt:obj_doc, obj=mapping.objectstore, classes=[mapping.objectstore.Session, mapping.objectstore.UnitOfWork] &> +<& pydoc.myt:obj_doc, obj=mapping.objectstore, classes=[mapping.objectstore.Session, mapping.objectstore.Session.SessionTrans, mapping.objectstore.UnitOfWork] &> +<& pydoc.myt:obj_doc, obj=exceptions &> + diff --git a/lib/sqlalchemy/mapping/objectstore.py b/lib/sqlalchemy/mapping/objectstore.py index aa8e9fe2ec..8f5f4eb0be 100644 --- a/lib/sqlalchemy/mapping/objectstore.py +++ b/lib/sqlalchemy/mapping/objectstore.py @@ -84,14 +84,17 @@ class Session(object): get_row_key = staticmethod(get_row_key) class SessionTrans(object): + """returned by Session.begin(), denotes a transactionalized UnitOfWork instance. + call commit() on this to commit the transaction.""" def __init__(self, parent, uow, isactive): self.__parent = parent self.__isactive = isactive self.__uow = uow - isactive = property(lambda s:s.__isactive) - parent = property(lambda s:s.__parent) - uow = property(lambda s:s.__uow) + isactive = property(lambda s:s.__isactive, doc="True if this SessionTrans is the 'active' transaction marker, else its a no-op.") + parent = property(lambda s:s.__parent, doc="returns the parent Session of this SessionTrans object.") + uow = property(lambda s:s.__uow, doc="returns the parent UnitOfWork corresponding to this transaction.") def begin(self): + """calls begin() on the underlying Session object, returning a new no-op SessionTrans object.""" return self.parent.begin() def commit(self): """commits the transaction noted by this SessionTrans object."""