if self.old_style:
del self.origin.data[self.key]
else:
- for facet in self.facethash:
- del self.origin.data[".".join((self.key, facet))]
+ for facet in dict(self.facethash):
+ self.remove_facet(facet)
del self.universe.categories[self.category][self.subkey]
del self.universe.contents[self.key]
del self
def remove_facet(self, facet):
"""Remove a facet from the element."""
- if self.has_facet(facet):
- del(self.origin.data[self.key][facet])
- self.origin.modified = True
+ if self.old_style and self.has_facet(facet):
+ del self.origin.data[self.key][facet]
+ elif ".".join((self.key, facet)) in self.origin.data:
+ del self.origin.data[".".join((self.key, facet))]
+ if facet in self.facethash:
+ del self.facethash[facet]
+ self.origin.modified = True
def ancestry(self):
"""Return a list of the element's inheritance lineage."""