]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
remove needless check_modified()
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Jan 2010 17:51:45 +0000 (17:51 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Jan 2010 17:51:45 +0000 (17:51 +0000)
lib/sqlalchemy/orm/identity.py
lib/sqlalchemy/orm/state.py
test/orm/test_attributes.py

index 4c1618df9b7304082ea7efabbffa29a30513718a..69ca31eda0a76938699450474e51f7215ace8e8a 100644 (file)
@@ -236,7 +236,7 @@ class StrongInstanceDict(IdentityMap):
         """prune unreferenced, non-dirty states."""
         
         ref_count = len(self)
-        dirty = [s.obj() for s in self.all_states() if s.check_modified()]
+        dirty = [s.obj() for s in self.all_states() if s.modified]
 
         # work around http://bugs.python.org/issue6149
         keepers = weakref.WeakValueDictionary()
index 3e80b703fd4aef1a1a4816461d30ac582d760edb..8dd6bd309f369420db0ce97cdcc1e345c245d840 100644 (file)
@@ -68,10 +68,6 @@ class InstanceState(object):
     def sort_key(self):
         return self.key and self.key[1] or (self.insert_order, )
 
-    def check_modified(self):
-        # TODO: deprecate
-        return self.modified
-
     def initialize_instance(*mixed, **kwargs):
         self, instance, args = mixed[0], mixed[1], mixed[2:]
         manager = self.manager
index c312b37aa9ebef39e0e54f447bd42a1a955cfa49..c69021aa3d7fa3db1707512cd4df0158da650bb8 100644 (file)
@@ -573,7 +573,7 @@ class AttributesTest(_base.ORMTest):
         x.element = ['one', 'two', 'three']
         attributes.instance_state(x).commit_all(attributes.instance_dict(x))
         x.element[1] = 'five'
-        assert attributes.instance_state(x).check_modified()
+        assert attributes.instance_state(x).modified
 
         attributes.unregister_class(Foo)
 
@@ -583,7 +583,7 @@ class AttributesTest(_base.ORMTest):
         x.element = ['one', 'two', 'three']
         attributes.instance_state(x).commit_all(attributes.instance_dict(x))
         x.element[1] = 'five'
-        assert not attributes.instance_state(x).check_modified()
+        assert not attributes.instance_state(x).modified
 
     def test_descriptorattributes(self):
         """changeset: 1633 broke ability to use ORM to map classes with unusual