Fixed attribute bug in typeclass swap.
This commit is contained in:
parent
874e3edb2a
commit
3014909feb
1 changed files with 4 additions and 6 deletions
|
|
@ -1204,16 +1204,14 @@ class TypedObject(SharedMemoryModel):
|
||||||
# Clean out old attributes
|
# Clean out old attributes
|
||||||
if is_iter(clean_attributes):
|
if is_iter(clean_attributes):
|
||||||
for attr in clean_attributes:
|
for attr in clean_attributes:
|
||||||
self.attr(attr, delete=True)
|
self.attributes.remove(attr)
|
||||||
for nattr in clean_attributes:
|
for nattr in clean_attributes:
|
||||||
if hasattr(self.ndb, nattr):
|
if hasattr(self.ndb, nattr):
|
||||||
self.nattr(nattr, delete=True)
|
self.nattributes.remove(nattr)
|
||||||
else:
|
else:
|
||||||
#print "deleting attrs ..."
|
#print "deleting attrs ..."
|
||||||
for attr in self.get_all_attributes():
|
self.attributes.clear()
|
||||||
attr.delete()
|
self.nattributes.clear()
|
||||||
for nattr in self.ndb.all:
|
|
||||||
del nattr
|
|
||||||
|
|
||||||
if run_start_hooks:
|
if run_start_hooks:
|
||||||
# run hooks for this new typeclass
|
# run hooks for this new typeclass
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue