From: Mike Bayer Date: Wed, 20 Jan 2016 17:22:17 +0000 (-0500) Subject: - clarify the "Adding" section also illustrates updates, fixes #2942 X-Git-Tag: rel_1_0_12~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b425fd8eda882300e01a447c95a2c590811a7096;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - clarify the "Adding" section also illustrates updates, fixes #2942 (cherry picked from commit 02271efd8976154f855646478b5438db078f7101) --- diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 9e0d262cd8..e44d7a8d5a 100644 --- a/doc/build/orm/tutorial.rst +++ b/doc/build/orm/tutorial.rst @@ -346,8 +346,8 @@ used, it retrieves a connection from a pool of connections maintained by the session object. -Adding New Objects -================== +Adding and Updating Objects +=========================== To persist our ``User`` object, we :meth:`~.Session.add` it to our :class:`~sqlalchemy.orm.session.Session`:: @@ -438,7 +438,10 @@ and that three new ``User`` objects are pending: We tell the :class:`~sqlalchemy.orm.session.Session` that we'd like to issue all remaining changes to the database and commit the transaction, which has -been in progress throughout. We do this via :meth:`~.Session.commit`: +been in progress throughout. We do this via :meth:`~.Session.commit`. The +:class:`~sqlalchemy.orm.session.Session` emits the ``UPDATE`` statement +for the password change on "ed", as well as ``INSERT`` statements for the +three new ``User`` objects we've added: .. sourcecode:: python+sql