diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-01-20 12:22:17 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-01-20 12:22:17 -0500 |
commit | 02271efd8976154f855646478b5438db078f7101 (patch) | |
tree | ed0cc9d7b342495b7fc866a7ed18775d1b5a3c16 | |
parent | 165fa15b0f9dbca50539aa7da377c5da5ac0fc79 (diff) | |
download | sqlalchemy-02271efd8976154f855646478b5438db078f7101.tar.gz |
- clarify the "Adding" section also illustrates updates, fixes #2942
-rw-r--r-- | doc/build/orm/tutorial.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 4349f75f2..559367121 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 |