summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-09-05 23:05:39 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-09-05 23:05:39 +0000
commit5edafbe9551ca12239f434f7165fea2d4de8d296 (patch)
tree1e97bdb65f88fac46376773037e1e5d55701f992
parentc3c79b997b4550c1696aa21ffbbe560c30262677 (diff)
downloadsqlalchemy-5edafbe9551ca12239f434f7165fea2d4de8d296.tar.gz
do the cheaper check first....
-rw-r--r--lib/sqlalchemy/orm/attributes.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 7290e2ac2..c2746d9e9 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -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