]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- also caveats for update() / delete() regarding single
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Sep 2016 22:36:01 +0000 (18:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 12 Sep 2016 22:36:30 +0000 (18:36 -0400)
table inheritance

Change-Id: If1511812a22a53537409f902f73e2e52ae3e4a3d
(cherry picked from commit 992344334328dba385fe6aa7694cfe3c13adc9d6)

lib/sqlalchemy/orm/query.py

index f74fd44bbcdb299a6715713acc8ddb83f12c33d9..cb712c94b3356589f8edb9a52cd24ee1277a60b5 100644 (file)
@@ -3099,6 +3099,11 @@ class Query(object):
               mappings unless you have taken the additional steps to make
               this feasible**.
 
+            * The polymorphic identity WHERE criteria is **not** included
+              for single- or
+              joined- table updates - this must be added **manually** even
+              for single table inheritance.
+
             * The method does **not** offer in-Python cascading of
               relationships - it is assumed that ON DELETE CASCADE/SET
               NULL/etc. is configured for any foreign key references
@@ -3256,6 +3261,11 @@ class Query(object):
                         filter(Employee.name == 'dilbert').\\
                         update({"engineer_type": "programmer"})
 
+            * The polymorphic identity WHERE criteria is **not** included
+              for single- or
+              joined- table updates - this must be added **manually**, even
+              for single table inheritance.
+
             * The :meth:`.MapperEvents.before_update` and
               :meth:`.MapperEvents.after_update`
               events **are not invoked from this method**.  Instead, the