summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index a402a9e91..a41cdac9d 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -353,10 +353,20 @@ class AttributeManager(object):
try:
attr = obj.__dict__['_managed_attributes']
except KeyError:
+ trigger = obj.__dict__.pop('_managed_trigger', None)
+ if trigger:
+ trigger()
attr = {}
obj.__dict__['_managed_attributes'] = attr
return attr
+ def trigger_history(self, obj, callable):
+ try:
+ del obj.__dict__['_managed_attributes']
+ except KeyError:
+ pass
+ obj.__dict__['_managed_trigger'] = callable
+
def reset_history(self, obj, key):
"""removes the history object for the given attribute on the given object.
When the attribute is next accessed, a new container will be created via the