Validates all field values for the model.
514815
def validate(self):
        

        errors = {}

        for name, field in self.fields:
            try:
                field.validate(self._state.get(name))
            except Exception as e:
                errors[name] = e

        if len(errors) is not 0:
            raise Exception(errors)

        return True
989594
def validate(self):
        """"""
        # check if required_fields aren't present
        for field in set(self.required_fields) - set(self.request_data):
            if not isinstance(field, string_types):
                # field was a collection, iterate over it and check by OR
                return bool(set(field) & set(self.request_data))
            return False
        return True
762064
def _validate(self):
        
        errors = []
        for k in self._defaults.keys():
            try:
                validator = self._defaults[k]['validator']
                if validator is not None:
                    self[k] = validator(self[k])
            except ValueError as e:
                errors.append('\t{}: {}'.format(k, six.text_type(e)))

        if errors:
            raise ValueError(
                'Invalid configuration values were set: \n{}'.format('\n'.join(errors)))
1189733
def _validate_all(data, schema):
    
    vldtr = jsonschema.Draft4Validator(schema)  # :raises: SchemaError, ...
    errors = list(vldtr.iter_errors(data))

    return (not errors, [err.message for err in errors])
821354
protected function performValidation()
    {
        // All the fixed fields declared above are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$.
        foreach (array_keys($this->attributes()) as $attribute) {
            if (is_array($this->$attribute)) {
                foreach ($this->$attribute as $k => $v) {
                    if (!preg_match('~^[a-zA-Z0-9\.\-_]+$~', $k)) {
                        $this->addError("Invalid key '$k' used in Components Object for attribute '$attribute', does not match ^[a-zA-Z0-9\.\-_]+\$.");
                    }
                }
            }
        }
    }
177584
def validate(self, value):
        
        if value in self.empty_values and self.required:
            raise ValidationError(self.error_messages['required'])
1220640
protected function verifyFieldValuesRequirements()
    {
        if (!isset($this->requiredFieldValues)) {
            return;
        }

        $iterator = $this->requiredFieldValues->getArrayCopy();

        foreach ($iterator as $fieldName => $validator) {
            if ($validator instanceof RequestValidator) {
                $validator->run($this, $fieldName);

                continue;
            }

            if (CommonUtils::isValidArray($validator)) {
                if (!in_array($this->$fieldName, $validator)) {
                    throw new \Genesis\Exceptions\ErrorParameter(
                        sprintf(
                            'Required parameter %s is set to %s, but expected to be one of (%s)',
                            $fieldName,
                            $this->$fieldName,
                            implode(
                                ', ',
                                CommonUtils::getSortedArrayByValue($validator)
                            )
                        )
                    );
                }

                continue;
            }

            if ($this->$fieldName !== $validator) {
                throw new \Genesis\Exceptions\ErrorParameter(
                    sprintf(
                        'Required parameter %s is set to %s, but expected to be %s',
                        $fieldName,
                        $this->$fieldName,
                        $validator
                    )
                );
            }
        }
    }
1113914
def validate(self, value) :
        """"""
        for v in self.validators :
            v.validate(value)
        return True
733196
def validate(self, value):
        ""

        # Use the parent's handling of required fields, etc.
        super(MultiEmailField, self).validate(value)

        for email in value:
            validate_email(email)
874250
@SuppressWarnings("unchecked")
    protected void validate() {

        if (m_ou == null) {
            m_name.removeAllValidators();
            m_name.addValidator(new NameValidator());
        }
        m_description.setRequired(true);
        m_description.setRequiredError("Required");

        if (m_ouResources.getRows().isEmpty() & !m_webuser.getValue().booleanValue()) {
            CmsPathSelectField field = new CmsPathSelectField();
            field.setUseRootPaths(true);
            field.setCmsObject(m_cms);
            m_ouResources.addRow(field);
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            ((AbstractField<String>)row.getComponent()).removeAllValidators();
            ((AbstractField<String>)row.getComponent()).addValidator(new ResourceValidator());
        }
    }
970028
def _validate_valueschema(self, schema, field, value):
        
        schema_crumb = (field, 'valueschema')
        if isinstance(value, Mapping):
            validator = self._get_child_validator(
                document_crumb=field, schema_crumb=schema_crumb,
                schema=dict((k, schema) for k in value))
            validator(value, update=self.update, normalize=False)
            if validator._errors:
                self._drop_nodes_from_errorpaths(validator._errors, [], [2])
                self._error(field, errors.VALUESCHEMA, validator._errors)
929395
def validate(self, value, model_instance):
        """"""
        # raise validation error if the use of this field says it can't be blank but it is
        if not self.blank and value is self.Empty:
            raise ValidationError(self.error_messages['blank'])
        else:
            return super(OpaqueKeyField, self).validate(value, model_instance)
143828
def validate(self, message):
        
        for key, field in self.fields.items():
            if key not in message:
                raise ValidationError(message, "Field %r is missing" % (key, ))
            field.validate(message[key])

        if self.allow_additional_fields:
            return
        # Otherwise, additional fields are not allowed:
        fieldSet = set(self.fields) | set(RESERVED_FIELDS)
        for key in message:
            if key not in fieldSet:
                raise ValidationError(message, "Unexpected field %r" % (key, ))
15085
public function validate($fields = null)
    {
        $this->_di->modelsValidator->validate($this, $fields ?: $this->getChangedFields());
    }
554172
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (in_array($this->user_value, array_keys($this->options)) && !in_array($this->user_value,
                    $this->disabled)
            ) {
                $this->is_valid = true;
            } elseif ('' == $this->user_value && $this->addBlank && !in_array('', $this->disabled)) {
                $this->is_valid = true;
            } elseif (false == $this->validator) {
                // This field does not get validated
                $this->is_valid = true;
            } else {
                $this->is_valid = false;
                $this->error = 'The provided value is not valid. Please enter a valid value.';
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
747622
def validate_value(self, value):
        """"""
        if self.readonly:
            raise ValidationError(self.record, "Cannot set readonly field '{}'".format(self.name))
        if value not in (None, self._unset):
            if self.supported_types and not isinstance(value, tuple(self.supported_types)):
                raise ValidationError(self.record, "Field '{}' expects one of {}, got '{}' instead".format(
                    self.name,
                    ', '.join([repr(t.__name__) for t in self.supported_types]),
                    type(value).__name__)
                )
1239115
def validate(record, field_name, bindings = {})
      if validations
        validations.collect do |validation|
          unless valid_value?(validation, record, field_name, bindings)
            FieldValidationError.new(validation, record, field_name, pos, width)
          end
        end.compact
      elsif record && record[field_name]
        # when no validation rules exist for the field, just check if the field exists in the record
        []
      else
        raise "found field value nil in #{record} field #{field_name}, shouldn't be possible?"
      end
    end