summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-04 16:36:11 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-04 16:36:11 +0000
commite6ba4d94264974ac0832fc24db4a48f928965fc4 (patch)
tree3f7691b4c447751951c7dd0f963e22c9c0b982cd
parent0156f1a9a76e396c92ac6d71a809d338dab7963e (diff)
downloadsqlalchemy-e6ba4d94264974ac0832fc24db4a48f928965fc4.tar.gz
- accept 'expire' with a deprecation warning for query.update() [ticket:1648]
-rw-r--r--CHANGES3
-rw-r--r--lib/sqlalchemy/orm/query.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index db6a7e673..1ea57e02e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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")