fairdm.contrib.contributors.validators#

Validators for the contributors app.

Module Contents#

Functions#

validate_iso_639_1_language_code

Validate a two-letter lowercase ISO 639-1 language code such as en.

validate_iso_639_1_language_codes

Validate that every element of a list is an ISO 639-1 language code.

Data#

API#

ISO_639_1_CODES#

‘frozenset(…)’

validate_iso_639_1_language_code(value)[source]#

Validate a two-letter lowercase ISO 639-1 language code such as en.

Args: value: The code to check.

Raises: ValidationError: The value is not an ISO 639-1 code.

validate_iso_639_1_language_codes(value)[source]#

Validate that every element of a list is an ISO 639-1 language code.

An invalid element raises the ValidationError of the single-code validator.

Args: value: The list of codes, or an empty value.