]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- accept 'expire' with a deprecation warning for query.update() [ticket:1648]
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Jan 2010 16:36:11 +0000 (16:36 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Jan 2010 16:36:11 +0000 (16:36 +0000)
CHANGES
lib/sqlalchemy/orm/query.py

diff --git a/CHANGES b/CHANGES
index db6a7e6735bc4eea67034da0a664360012efdc28..1ea57e02e39a42129b0d76bf74167e14f16a50e4 100644 (file)
--- 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.
index 27433627be03abc0d9cf6aebfa38591726d3719e..eef60a8afa2b9b03755e9e611026130e6d3a8093 100644 (file)
@@ -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")