Logo Search packages:      
Sourcecode: zope-atseng version File versions  Download package

def ATSchemaEditorNG::SchemaEditor::SchemaEditor::atse_delSchemata (   self,
  schema_id,
  schema_template,
  name,
  RESPONSE = None 
)

delete a schemata 

Definition at line 362 of file SchemaEditor.py.

00362                                                                                :
        """ delete a schemata """
        S = self.atse_getSchemaById(schema_id)

        if S._undeleteable_schematas.has_key(name): 
            raise SchemaEditorError(self.translate('atse_can_not_remove_schema', 
                                                   default='Can not remove this schema because it is protected from deletion',
                                                   domain='ATSchemaEditorNG'))
   
        if len(self.atse_getSchemataNames(schema_id, True)) == 1: 
            raise SchemaEditorError(self.translate('atse_can_not_remove_last_schema', 
                                                   default='Can not remove the last schema',
                                                   domain='ATSchemaEditorNG'))

        for field in S.getSchemataFields(name): 
            if S._undeleteable_fields.has_key(field.getName()):
                raise SchemaEditorError(self.translate('atse_schemata_contains_undeleteable_fields', 
                                        default='The schemata contains fields that can not be deleted',
                                        domain='ATSchemaEditorNG'))

        
        S.delSchemata(name)
        self._schemas[schema_id] = S
        util.redirect(RESPONSE, 
                      schema_template,
                      self.translate('atse_deleted', 
                                     default='Schemata deleted',
                                     domain='ATSchemaEditorNG'),
                      schemata=self.atse_getSchemataNames(schema_id, True)[0],
                      schema_id=schema_id)

    ######################################################################


Generated by  Doxygen 1.6.0   Back to index