]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- [feature] The 'objects' argument to
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Jun 2012 18:41:32 +0000 (14:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 8 Jun 2012 18:41:32 +0000 (14:41 -0400)
flush() is no longer deprecated, as some
valid use cases have been identified.

CHANGES
lib/sqlalchemy/orm/session.py
test/orm/test_cascade.py
test/orm/test_session.py

diff --git a/CHANGES b/CHANGES
index 6cbaf125bf8c4b761971967c75d6f171a529161c..fcf71433c827aa5e34a9b83ad625dd02628702ec 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,10 @@ CHANGES
     to [ticket:1892] as this was supposed
     to be part of that, this is [ticket:2491].
 
+  - [feature] The 'objects' argument to 
+    flush() is no longer deprecated, as some
+    valid use cases have been identified.  
+
 - engine
   - [bug] Fixed memory leak in C version of
     result proxy whereby DBAPIs which don't deliver
index 14778705d03798d9201ae0056b6fd24c37fcf210..69bc9248eb3805beac7fcb12382172b5b1c7d82e 100644 (file)
@@ -1563,20 +1563,15 @@ class Session(object):
         will create a transaction on the fly that surrounds the entire set of
         operations int the flush.
 
-        objects
-          Optional; a list or tuple collection.  Restricts the flush operation
-          to only these objects, rather than all pending changes.
-          Deprecated - this flag prevents the session from properly maintaining
-          accounting among inter-object relations and can cause invalid results.
+        :param objects: Optional; restricts the flush operation to operate 
+          only on elements that are in the given collection.
+          
+          This feature is for an extremely narrow set of use cases where
+          particular objects may need to be operated upon before the 
+          full flush() occurs.  It is not intended for general use.
 
         """
 
-        if objects:
-            util.warn_deprecated(
-                "The 'objects' argument to session.flush() is deprecated; "
-                "Please do not add objects to the session which should not "
-                "yet be persisted.")
-
         if self._flushing:
             raise sa_exc.InvalidRequestError("Session is already flushing")
 
index 26ea78da1c9774fa8aeea7ec19d7d092c58c00a3..ebd1e4476efd83c1f4225e1cd88ea8163aab1358 100644 (file)
@@ -2611,7 +2611,6 @@ class PartialFlushTest(fixtures.MappedTest):
             Column("parent_id", Integer, ForeignKey("parent.id"))
         )
 
-    @testing.uses_deprecated()
     def test_o2m_m2o(self):
         base, noninh_child = self.tables.base, self.tables.noninh_child
 
@@ -2662,7 +2661,6 @@ class PartialFlushTest(fixtures.MappedTest):
         assert c2 in sess and c2 not in sess.new
         assert b1 in sess and b1 in sess.new
 
-    @testing.uses_deprecated()
     def test_circular_sort(self):
         """test ticket 1306"""
 
index 79852c7a4a4fb44910df310b9505d962e8760a1a..f6521c9f299d2b07be3717b033bc0a714daa23c4 100644 (file)
@@ -1226,7 +1226,6 @@ class SessionInterface(fixtures.TestBase):
                       Integer, primary_key=True,
                       test_needs_autoincrement=True)))
 
-    @testing.uses_deprecated()
     def _test_instance_guards(self, user_arg):
         watchdog = set()