fairdm.core.project.validators#
Validators for the project app.
Module Contents#
Functions#
Validate that a value is a list of DataCite funding references. |
Data#
API#
- FUNDING_REFERENCE_KEYS#
‘frozenset(…)’
- FUNDER_IDENTIFIER_TYPES#
(‘ISNI’, ‘GRID’, ‘Crossref Funder ID’, ‘ROR’, ‘Other’)
- validate_funding(value)[source]#
Validate that a value is a list of DataCite funding references.
A project may carry several funding records, so the stored value must be a list. Each member must be an object carrying only keys from
FUNDING_REFERENCE_KEYS, withfunderNamerequired and every other key optional. AfunderIdentifierType, when present, must be one of DataCite’s identifier schemes.Args: value: The funding value to validate.
Raises: ValidationError: The value is not a list of funding reference objects. The error code is
funding_not_list,funding_unknown_key,funding_missing_funder_name,funding_invalid_typeorfunding_invalid_identifier_type.