]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
do the cheaper check first....
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Sep 2007 23:05:39 +0000 (23:05 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Sep 2007 23:05:39 +0000 (23:05 +0000)
lib/sqlalchemy/orm/attributes.py

index 7290e2ac23e5aeee91a52cbb5e51a3f07b2a7eac..c2746d9e98cde91297132c8f14c0604224f09bfe 100644 (file)
@@ -702,10 +702,15 @@ class AttributeManager(object):
             return noninherited
 
     def is_modified(self, object):
-        for attr in self.managed_attributes(object.__class__):
-            if attr.check_mutable_modified(object):
-                return True
-        return object._state.modified
+        if object._state.modified:
+            return True
+        else:
+            for attr in self.managed_attributes(object.__class__):
+                if attr.check_mutable_modified(object):
+                    return True
+            else:
+                return False
+
 
     def get_history(self, obj, key, **kwargs):
         """Return a new ``AttributeHistory`` object for the given