]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
check extensions each time; user-defined code will be appending to "extensions" after...
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Aug 2008 15:41:43 +0000 (15:41 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 29 Aug 2008 15:41:43 +0000 (15:41 +0000)
lib/sqlalchemy/orm/attributes.py

index 0b36d5f0cd84d8798e85a1ae9723a7f0e1175e7a..2d7c726a1f7261bec6f7d36504d5de3fd9886d18 100644 (file)
@@ -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)