diff options
author | Mario Lassnig <mario@lassnig.net> | 2013-11-28 14:50:41 +0100 |
---|---|---|
committer | Mario Lassnig <mario@lassnig.net> | 2013-11-28 14:50:41 +0100 |
commit | e9aaf8eb66343f247b1ec2189707f820e20a0629 (patch) | |
tree | fe5af6902c88668146b278b5494941d545d9233a /lib/sqlalchemy/sql/compiler.py | |
parent | 741da873841012d893ec08bd77a5ecc9237eaab8 (diff) | |
download | sqlalchemy-pr/42.tar.gz |
added LockmodeArgspr/42
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4f3dbba36..54eb1f9eb 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1570,7 +1570,12 @@ class SQLCompiler(Compiled): return "" def for_update_clause(self, select): - if select.for_update: + # backwards compatibility + if isinstance(select.for_update, bool): + return " FOR UPDATE" if select.for_update else "" + elif isinstance(select.for_update, str): + return " FOR UPDATE" + elif select.for_update.mode is not None: return " FOR UPDATE" else: return "" |