From: Mike Bayer Date: Thu, 7 Jan 2010 17:51:45 +0000 (+0000) Subject: remove needless check_modified() X-Git-Tag: rel_0_6beta1~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ee80994a37c19d407f18266c8ab7184e8e8ad96;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git remove needless check_modified() --- diff --git a/lib/sqlalchemy/orm/identity.py b/lib/sqlalchemy/orm/identity.py index 4c1618df9b..69ca31eda0 100644 --- a/lib/sqlalchemy/orm/identity.py +++ b/lib/sqlalchemy/orm/identity.py @@ -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() diff --git a/lib/sqlalchemy/orm/state.py b/lib/sqlalchemy/orm/state.py index 3e80b703fd..8dd6bd309f 100644 --- a/lib/sqlalchemy/orm/state.py +++ b/lib/sqlalchemy/orm/state.py @@ -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 diff --git a/test/orm/test_attributes.py b/test/orm/test_attributes.py index c312b37aa9..c69021aa3d 100644 --- a/test/orm/test_attributes.py +++ b/test/orm/test_attributes.py @@ -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