Added the ability to clean the attribute_cache on a per-object bases using obj.flush_attr_cache().

This commit is contained in:
Griatch 2012-09-29 16:02:43 +02:00
parent a8dcfff248
commit a347252407

View file

@ -1614,6 +1614,12 @@ class TypedObject(SharedMemoryModel):
if hperm in [p.lower() for p in self.permissions] and hpos > ppos)
return False
def flush_attr_cache(self):
"""
Flush only the attribute cache for this object.
"""
_ATTRIBUTE_CACHE[_GA(self, "hashid")] = {}
def flush_from_cache(self):
"""
Flush this object instance from cache, forcing an object reload. Note that this