From: Michael Trier Date: Fri, 2 Jan 2009 04:54:45 +0000 (+0000) Subject: Modified UOW so that a Row Switch scenario will not attempt to update the Primary... X-Git-Tag: rel_0_5_0~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a52a0c43c3d4880df53c46d1fd92fcf8d1a3a758;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Modified UOW so that a Row Switch scenario will not attempt to update the Primary Key. --- diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 0dc3465327..1e257f9a47 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1318,6 +1318,9 @@ class Mapper(object): params[col._label] = prop.get_col_value(col, history.deleted[0]) else: # row switch logic can reach us here + # remove the pk from the update params so the update doesn't + # attempt to include the pk in the update statement + del params[col.key] params[col._label] = prop.get_col_value(col, history.added[0]) hasdata = True elif col in pks: