From 55a6edef96086f5a23865d81cd7d9ca96209967c Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Wed, 3 Dec 2008 04:52:55 +0000 Subject: Modified the docstring for Session.add() with lots of help. --- lib/sqlalchemy/orm/session.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index c98cbe6b3..b2764def4 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) -- cgit v1.2.1