inspirehep.modules.forms.validators package

Submodules

inspirehep.modules.forms.validators.dynamic_fields module

class inspirehep.modules.forms.validators.dynamic_fields.AuthorsValidation(form, field)[source]

Bases: object

Validate authors field.

empty_aff: validates if there are empty names with filled affiliations.

author_names: validates if there is at least one author.

field_flags = ('required',)
class inspirehep.modules.forms.validators.dynamic_fields.LessThan(fieldname, message=None)[source]

Bases: object

Compares the values of two fields. param fieldname: the name of the other field to compare to. param message: error message to raise in case of a validation error. Can be interpolated with %(other_label)s and %(other_name)s to provide a more helpful error.

inspirehep.modules.forms.validators.simple_fields module

inspirehep.modules.forms.validators.simple_fields.already_pending_in_holdingpen_validator(property_name, value)[source]

Check if there’s a submission in the holdingpen with the same arXiv ID.

inspirehep.modules.forms.validators.simple_fields.arxiv_id_already_pending_in_holdingpen_validator(form, field)[source]

Check if there’s a submission in the holdingpen with the same arXiv ID.

inspirehep.modules.forms.validators.simple_fields.arxiv_syntax_validation(form, field)[source]

Validate ArXiv ID syntax.

inspirehep.modules.forms.validators.simple_fields.date_validator(form, field)[source]
inspirehep.modules.forms.validators.simple_fields.does_exist_in_inspirehep(query, collections=None)[source]

Check if there exist an item in the db which satisfies query.

Parameters:
  • query – http query to check
  • collections – collections to search in; by default searches in the default collection
inspirehep.modules.forms.validators.simple_fields.doi_already_pending_in_holdingpen_validator(form, field)[source]

Check if there’s a submission in the holdingpen with the same DOI.

inspirehep.modules.forms.validators.simple_fields.duplicated_arxiv_id_validator(form, field)[source]

Check if a record with the same arXiv ID already exists.

inspirehep.modules.forms.validators.simple_fields.duplicated_doi_validator(form, field)[source]

Check if a record with the same doi already exists.

inspirehep.modules.forms.validators.simple_fields.duplicated_orcid_validator(form, field)[source]

Check if a record with the same ORCID already exists.

inspirehep.modules.forms.validators.simple_fields.duplicated_validator(property_name, property_value)[source]
inspirehep.modules.forms.validators.simple_fields.inspirehep_duplicated_validator(inspire_query, property_name, collections=None)[source]

Check if a record with the same doi already exists.

Needs to be wrapped in a function with proper validator signature.

inspirehep.modules.forms.validators.simple_fields.no_pdf_validator(form, field)[source]

Validate that the field does not contain a link to a PDF.

inspirehep.modules.forms.validators.simple_fields.pdf_validator(form, field)[source]

Validate that the field contains a link to a PDF.

inspirehep.modules.forms.validators.simple_fields.year_validator(form, field)[source]

Validate that the field contains an year in an acceptable range.

Module contents