diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-06-06 13:54:33 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-06-06 13:54:33 -0400 |
commit | 6b68a70b5f903079f3c42a827daa3ea08a1a4b53 (patch) | |
tree | bd602ca0b8f63a845b555c9d3039e4f9c10b25d9 /lib | |
parent | a2099ed44f390f1d480341907a4dc601f9195ec9 (diff) | |
download | sqlalchemy-6b68a70b5f903079f3c42a827daa3ea08a1a4b53.tar.gz |
Re-send column value w/ onupdate default during post-update
Adjusted the behavior of post_update such that if a column with
an "onupdate" default has received an explicit value for
INSERT, re-send the same data during a post-update UPDATE so
that the value remains in effect, rather than an onupdate
overwriting it.
Change-Id: I26bccb6f957dcad07a2bcbda2dd9e14c60b92b06
Fixes: #3471
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index 5fa9701ba..0de64011a 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -591,7 +591,7 @@ def _collect_post_update_commands(base_mapper, uowtransaction, table, state, state_dict, col, passive=attributes.PASSIVE_OFF) - elif col in post_update_cols: + elif col in post_update_cols or col.onupdate is not None: prop = mapper._columntoproperty[col] history = state.manager[prop.key].impl.get_history( state, state_dict, |