diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-04 16:36:11 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-04 16:36:11 +0000 |
commit | e6ba4d94264974ac0832fc24db4a48f928965fc4 (patch) | |
tree | 3f7691b4c447751951c7dd0f963e22c9c0b982cd | |
parent | 0156f1a9a76e396c92ac6d71a809d338dab7963e (diff) | |
download | sqlalchemy-e6ba4d94264974ac0832fc24db4a48f928965fc4.tar.gz |
- accept 'expire' with a deprecation warning for query.update() [ticket:1648]
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 6 |
2 files changed, 8 insertions, 1 deletions
@@ -19,7 +19,8 @@ CHANGES - orm - Changes to query.update() and query.delete(): - the 'expire' option on query.update() has been renamed to - 'fetch', thus matching that of query.delete() + 'fetch', thus matching that of query.delete(). + 'expire' is deprecated and issues a warning. - query.update() and query.delete() both default to 'evaluate' for the synchronize strategy. diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 27433627b..eef60a8af 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1714,6 +1714,12 @@ class Query(object): #TODO: updates of manytoone relations need to be converted to fk assignments #TODO: cascades need handling. + if synchronize_session == 'expire': + util.warn_deprecated("The 'expire' value as applied to " + "the synchronize_session argument of " + "query.update() is now called 'fetch'") + synchronize_session = 'fetch' + if synchronize_session not in [False, 'evaluate', 'fetch']: raise sa_exc.ArgumentError("Valid strategies for session synchronization are False, 'evaluate' and 'fetch'") self._no_select_modifiers("update") |