Skip to content

Latest commit

 

History

History
354 lines (213 loc) · 10.7 KB

validation_api.rst

File metadata and controls

354 lines (213 loc) · 10.7 KB

Validation API

ValidationError

ValidationError is part of the validators module, but is so commonly used when implementing custom validation that it's exposed as part of the top-level newforms API.

Errors

Validation errors for a whole form are held in an ErrorObject, while each field's validation errors are (by default) held im an ErrorList.

Validators

Newforms depends on the validators module and exposes its version of it as forms.validators.

Constructors in the validators module are actually validation function factories -- they can be called with or without new and will return a Function which performs the configured validation when called.