From 9588b6b244f3de614c8a1eb6242d39805da5b1b8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 20 Jan 2016 12:22:17 -0500 Subject: [PATCH] - clarify the "Adding" section also illustrates updates, fixes #2942 (cherry picked from commit 02271efd8976154f855646478b5438db078f7101) --- doc/build/orm/tutorial.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 31579ef3ba..29ac4754e9 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 -- 2.47.3