summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-03-02 01:45:31 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-03-02 01:45:31 +0000
commit9985d21385ca8a478dcdd7d989982295775d0383 (patch)
tree88e1e943295c4abb6b303728f1794e50f9f02217 /lib/sqlalchemy/attributes.py
parent2d47f5a0b99b9df89f6e01027fa8159a39307d33 (diff)
downloadsqlalchemy-9985d21385ca8a478dcdd7d989982295775d0383.tar.gz
added objectstore.refresh(), including supporting changes in mapper, attributes, util
Diffstat (limited to 'lib/sqlalchemy/attributes.py')
-rw-r--r--lib/sqlalchemy/attributes.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/attributes.py b/lib/sqlalchemy/attributes.py
index bea125371..08178324f 100644
--- a/lib/sqlalchemy/attributes.py
+++ b/lib/sqlalchemy/attributes.py
@@ -65,6 +65,8 @@ class PropHistory(object):
self.extension = extension
def gethistory(self, *args, **kwargs):
return self
+ def clear(self):
+ del self.obj.__dict__[self.key]
def history_contains(self, obj):
return self.orig is obj or self.obj.__dict__[self.key] is obj
def setattr_clean(self, value):
@@ -314,7 +316,8 @@ class AttributeManager(object):
pass
def remove(self, obj):
- """not sure what this is."""
+ """called when an object is totally being removed from memory"""
+ # currently a no-op since the state of the object is attached to the object itself
pass
def create_history(self, obj, key, uselist, callable_=None, **kwargs):
@@ -350,6 +353,8 @@ class AttributeManager(object):
When the attribute is next accessed, a new container will be created via the
class-level history container definition."""
try:
+ x = self.attribute_history(obj)[key]
+ x.clear()
del self.attribute_history(obj)[key]
except KeyError:
pass