summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-08-29 15:41:43 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-08-29 15:41:43 +0000
commitebbae4fa0a936f6a4446bc7b4e165ff969d29fd0 (patch)
tree89dfb38e723589c59ffc529c036a714caf7eafde /lib/sqlalchemy/orm
parenta18035cfb16d8b55e460a9f3752c3b9f697e7729 (diff)
downloadsqlalchemy-ebbae4fa0a936f6a4446bc7b4e165ff969d29fd0.tar.gz
check extensions each time; user-defined code will be appending to "extensions" after the AttributeImpl has been constructed
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/attributes.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 0b36d5f0c..2d7c726a1 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -243,7 +243,7 @@ class AttributeImpl(object):
else:
self.is_equal = compare_function
self.extensions = util.to_list(extension or [])
- self.active_history = active_history or bool(self.extensions)
+ self.active_history = active_history
def hasparent(self, state, optimistic=False):
"""Return the boolean value of a `hasparent` flag attached to the given item.
@@ -374,7 +374,7 @@ class ScalarAttributeImpl(AttributeImpl):
def delete(self, state):
# TODO: catch key errors, convert to attributeerror?
- if self.active_history:
+ if self.active_history or self.extensions:
old = self.get(state)
else:
old = state.dict.get(self.key, NO_VALUE)
@@ -395,7 +395,7 @@ class ScalarAttributeImpl(AttributeImpl):
if initiator is self:
return
- if self.active_history:
+ if self.active_history or self.extensions:
old = self.get(state)
else:
old = state.dict.get(self.key, NO_VALUE)