Validation — Schematics 0.9.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Schematics 0.9.2 documentation »

# Validation

`schematics.validate.` `validate`(cls, instance_or_dict, partial=False, strict=False, context=None)

  Validate some untrusted data using a model. Trusted data can be passed in the context parameter.

  Parameters: | cls – The model class to use as source for validation. If given an instance, will also run instance-level validators on the data. raw_data – A `dict` or `dict`-like structure for incoming data. partial – Allow partial data to validate; useful for PATCH requests. Essentially drops the `required=True` arguments from field definitions. Default: False strict – Complain about unrecognized keys. Default: False context – A `dict`-like structure that may contain already validated data.
  Returns: | data data dict contains the valid raw_data plus the context data. If errors are found, they are raised as a ValidationError with a list of errors attached.

## Usage

To learn more about how Validation is used, visit Using Validation

### Navigation

- index
- modules |
- next |
- previous |
- Schematics 0.9.2 documentation »