Description

In ​the Validators documentation there claims to be a RequiredIfOtherFieldsNotGiven, but it doesn't actually exist. This implements the documented semantics and also introduces two supporting validators.

RequiredIfAllOtherFieldsNotGiven: Like the one mentioned above, but fails only when all of the other fields are not given (instead of any).AllValidators: Like AnyValidator, but passes only when all of the given validators pass.

The patch on ticket #2266 adds RequiredIfOtherFieldsNotGiven (with tests and updated docs) while this ticket offers RequiredIfOtherFieldsNotGiven and a new RequiredIfAllOtherFieldsNotGiven validators with tests but no docs.

Since the validator functions primarily exist to support the oldforms part of the framework, we aren't adding any extra functionality to it now. It's deprecated. The fact that validators can also be used in model fields is kind of a side-effect and some model-aware validation changes will slowly phase that out, too.