Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
 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)