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

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

synchronizes all unmanaged fields with the field
definitions specified in the file system source code 

Definition at line 304 of file SchemaEditor.py.

                                                     :
        """ synchronizes all unmanaged fields with the field
        definitions specified in the file system source code """
        unmanaged_fnames = self.atse_getUnmanagedFieldNames(schema_id)
        klass = self._obj_ptype[schema_id]
        src_schema = klass.schema
        atse_schema = self._schemas[schema_id]
        for field in src_schema.fields():
            fname = field.getName()
            if not atse_schema.has_key(fname):
                atse_schema.addFieldAfterFieldName(last_fname, field)
            elif fname in unmanaged_fnames:
                atse_schema.replaceField(fname, src_schema[fname].copy())
            last_fname = fname
        self._schemas._p_changed = 1
        if schema_template is not None and RESPONSE is not None:
            util.redirect(RESPONSE, schema_template,
                          self.translate('atse_fields_synced',
                                         default='Unmanaged and missing fields have been synchronized',
                                         domain='ATSchemaEditorNG'), 
                          schema_id=schema_id)

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


Generated by  Doxygen 1.6.0   Back to index