diff options
| author | Michael Trier <mtrier@gmail.com> | 2009-01-02 04:54:45 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2009-01-02 04:54:45 +0000 |
| commit | a52a0c43c3d4880df53c46d1fd92fcf8d1a3a758 (patch) | |
| tree | 2fccca3e4169dc1db8c84ec899e36140b5faf05b | |
| parent | 50e077ee52b404092cc4fc1969169ed5ed00e9f5 (diff) | |
| download | sqlalchemy-a52a0c43c3d4880df53c46d1fd92fcf8d1a3a758.tar.gz | |
Modified UOW so that a Row Switch scenario will not attempt to update the Primary Key.
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 0dc346532..1e257f9a4 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: |
