From 3014909feb1e1919a0c0d8ab38f55cba8e4f2206 Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 4 Aug 2014 12:15:10 +0200 Subject: [PATCH] Fixed attribute bug in typeclass swap. --- src/typeclasses/models.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index d5a235607..c96b4bc93 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -1204,16 +1204,14 @@ class TypedObject(SharedMemoryModel): # Clean out old attributes if is_iter(clean_attributes): for attr in clean_attributes: - self.attr(attr, delete=True) + self.attributes.remove(attr) for nattr in clean_attributes: if hasattr(self.ndb, nattr): - self.nattr(nattr, delete=True) + self.nattributes.remove(nattr) else: #print "deleting attrs ..." - for attr in self.get_all_attributes(): - attr.delete() - for nattr in self.ndb.all: - del nattr + self.attributes.clear() + self.nattributes.clear() if run_start_hooks: # run hooks for this new typeclass