def removeSchema(self, type): getSchema(type).remove(self.oid) if hasattr(self, '_v__providedBy'): del self._v__providedBy if self._v_schemas is not None: del self._v_schemas
def applySchema(self, type): getSchema(type).apply(self.oid) if hasattr(self, '_v__providedBy'): del self._v__providedBy if self._v_schemas is not None: del self._v_schemas
def getDatasheet(self, name, apply=False): sch = getSchema(name) if apply or (sch.name in self.schemas): wrapper = ISchemaWrapper(self, None) if wrapper is not None: return wrapper.wrapSchema(sch, self) return sch(self) else: raise KeyError(name)