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_1_0b1~84^2~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02271efd8976154f855646478b5438db078f7101;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - clarify the "Adding" section also illustrates updates, fixes #2942 --- diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 4349f75f2b..5593671213 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