summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-02-03 01:03:00 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-02-03 01:03:00 +0000
commit38eea593ed64fa848aa903c26c46f8ac0d78c007 (patch)
treeff398289fe63b71a036e0e2d98fbacfff3b80c9e /lib/sqlalchemy/attributes.py
parentfaeeb99a2100465814f2b74c74cde275c52cd119 (diff)
downloadsqlalchemy-38eea593ed64fa848aa903c26c46f8ac0d78c007.tar.gz
fixed set() to not re-set the same value
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index 29a79edd2..f2480918d 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -77,7 +77,10 @@ class PropHistory(object):
def setattr(self, value):
if isinstance(value, list):
raise ("assigning a list to scalar property '%s' on '%s' instance %d" % (self.key, self.obj.__class__.__name__, id(self.obj)))
- self.orig = self.obj.__dict__.get(self.key, None)
+ orig = self.obj.__dict__.get(self.key, None)
+ if orig is value:
+ return
+ self.orig = orig
self.obj.__dict__[self.key] = value
if self.extension is not None and self.orig is not value:
self.extension.set(self.obj, value, self.orig)