]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added public-friendly setattr_clean and append_clean
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Mar 2006 20:20:23 +0000 (20:20 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Mar 2006 20:20:23 +0000 (20:20 +0000)
lib/sqlalchemy/attributes.py

index 08178324fed33b282b9d7b1036e22d27e3df2c9d..cc926b19c8396495787fd556b3d311f472084d11 100644 (file)
@@ -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.