From 2386b308f511d4b57c7ab52a98b385365f2d9143 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 14 May 2013 08:44:40 +0200 Subject: [PATCH] Added flushing to attribute caches when an typed object is deleted. This fixes isse 295, but keeping that open for a little longer to see if some other solution can be devised. --- src/typeclasses/models.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index 849251388b..931b0e812e 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -826,6 +826,14 @@ class TypedObject(SharedMemoryModel): if any(("%s.%s" % (_GA(cls,"__module__"), _GA(cls,"__name__")) == typec for typec in typeclasses)))) + def delete(self, *args, **kwargs): + """ + Type-level cleanup + """ + flush_attr_cache() + super(TypedObject, self).delete(*args, **kwargs) + + # # Object manipulation methods #