summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-04 20:20:23 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-04 20:20:23 +0000
commitffc8dfbdec0903db84370c3466ccce5cb8316b7e (patch)
tree9cc97070726332c2a3a88755ac5162d792e857dd /lib/sqlalchemy/attributes.py
parent3cacdfcc310b348118bdf6500c51a5fc390dfdac (diff)
downloadsqlalchemy-ffc8dfbdec0903db84370c3466ccce5cb8316b7e.tar.gz
added public-friendly setattr_clean and append_clean
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index 08178324f..cc926b19c 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -50,7 +50,15 @@ class SmartProperty(object):
return self.manager.get_list_attribute(obj, self.key)
else:
return self.manager.get_attribute(obj, self.key)
-
+ def setattr_clean(self, obj, value):
+ """sets an attribute on an object without triggering a history event"""
+ h = self.manager.get_history(obj, self.key)
+ h.setattr_clean(value)
+ def append_clean(self, obj, value):
+ """appends a value to a list-based attribute without triggering a history event."""
+ h = self.manager.get_history(obj, self.key)
+ h.append_nohistory(value)
+
class PropHistory(object):
"""Used by AttributeManager to track the history of a scalar attribute
on an object instance. This is the "scalar history container" object.