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

def Formulator::Form::Form::validate_all (   self,
  REQUEST 
) [inherited]

Validate all enabled fields in this form, catch any ValidationErrors
if they occur and raise a FormValidationError in the end if any
Validation Errors occured.

Definition at line 372 of file Form.py.

00372                                    :
        """Validate all enabled fields in this form, catch any ValidationErrors
        if they occur and raise a FormValidationError in the end if any
        Validation Errors occured.
        """
        result = {}
        errors = []
        for field in self.get_fields():
            # skip any field we don't need to validate
            if not field.need_validate(REQUEST):
                continue
            try:
                value = field.validate(REQUEST)
                # store under id
                result[field.id] = value
                # store as alternate name as well if necessary
                alternate_name = field.get_value('alternate_name')
                if alternate_name:
                    result[alternate_name] = value
            except ValidationError, err:
                errors.append(err)
        if len(errors) > 0:
            raise FormValidationError(errors, result)
        return result

    security.declareProtected('View', 'validate_all_to_request')
    def validate_all_to_request(self, REQUEST):


Generated by  Doxygen 1.6.0   Back to index