From a34725240787f2c8c551a3f1ecaa4e854df06e8c Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 29 Sep 2012 16:02:43 +0200 Subject: [PATCH] Added the ability to clean the attribute_cache on a per-object bases using obj.flush_attr_cache(). --- src/typeclasses/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index 9dd7e2d874..3cb3f5415a 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -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