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.
Validation errors for a whole form are held in an ErrorObject
, while each field's validation errors are (by default) held im an ErrorList
.
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.