From: Michael Trier Date: Wed, 3 Dec 2008 04:52:55 +0000 (+0000) Subject: Modified the docstring for Session.add() with lots of help. X-Git-Tag: rel_0_5_0~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55a6edef96086f5a23865d81cd7d9ca96209967c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Modified the docstring for Session.add() with lots of help. --- diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index c98cbe6b36..b2764def46 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1091,13 +1091,13 @@ class Session(object): self._cascade_save_or_update(state) def add(self, instance): - """Add the given instance into this ``Session``. + """Place an object in the ``Session``. - TODO: rephrase the below in user terms; possibly tie into future - function that downgrades persistent to transient. [ticket:1052] + Its state will be persisted to the database on the next flush + operation. - The non-None state `key` on the instance's state determines whether - to ``save()`` or ``update()`` the instance. + Repeated calls to ``add()`` will be ignored. The opposite of ``add()`` + is ``expunge()``. """ state = _state_for_unknown_persistence_instance(instance)