geonature.core.imports.checks.sql.nomenclature#
Functions#
|
Set nomenclatures using content mapping. |
|
Check the existence of a nomenclature proof in the transient table. |
|
Raise an error if blurring not set. |
|
Check the nomenclature source status and raise an error if the status is "Lit" (Literature) |
Check the nomenclature source status and raise an error if the status is "Autre, préciser" |
Module Contents#
- geonature.core.imports.checks.sql.nomenclature.do_nomenclatures_mapping(imprt: geonature.core.imports.models.TImports, entity: geonature.core.imports.models.Entity, fields: Mapping[str, geonature.core.imports.models.BibFields], fill_with_defaults: bool = False) None [source]#
Set nomenclatures using content mapping.
Parameters#
- imprtTImports
The import to check.
- entityEntity
The entity to check.
- fieldsMapping[str, BibFields]
Mapping of field names to BibFields objects.
- fill_with_defaultsbool, optional
If True, fill empty user fields with default nomenclatures.
Notes#
See the following link for explanation on empty fields and default nomenclature handling: PnX-SI/gn_module_import#68
- geonature.core.imports.checks.sql.nomenclature.check_nomenclature_exist_proof(imprt: geonature.core.imports.models.TImports, entity: geonature.core.imports.models.Entity, nomenclature_field: geonature.core.imports.models.BibFields, digital_proof_field: geonature.core.imports.models.BibFields | None, non_digital_proof_field: geonature.core.imports.models.BibFields | None) None [source]#
Check the existence of a nomenclature proof in the transient table.
Parameters#
- imprtTImports
The import to check.
- entityEntity
The entity to check.
- nomenclature_fieldBibFields
The field representing the nomenclature to check.
- digital_proof_fieldOptional[BibFields]
The field for digital proof, if any.
- non_digital_proof_fieldOptional[BibFields]
The field for non-digital proof, if any.
- geonature.core.imports.checks.sql.nomenclature.check_nomenclature_blurring(imprt, entity, blurring_field, id_dataset_field, uuid_dataset_field)[source]#
Raise an error if blurring not set. Required if the dataset is private.
- geonature.core.imports.checks.sql.nomenclature.check_nomenclature_source_status(imprt: geonature.core.imports.models.TImports, entity: geonature.core.imports.models.Entity, source_status_field: geonature.core.imports.models.BibFields, ref_biblio_field: geonature.core.imports.models.BibFields) None [source]#
Check the nomenclature source status and raise an error if the status is « Lit » (Literature) whereas the reference biblio field is empty.
Parameters#
- imprtTImports
The import to check.
- entityEntity
The entity to check.
- source_status_fieldBibFields
The field representing the source status.
- ref_biblio_fieldBibFields
The field representing the reference bibliography.
Notes#
- The error codes are:
CONDITIONAL_MANDATORY_FIELD_ERROR: the field is mandatory and not set.
- geonature.core.imports.checks.sql.nomenclature.check_nomenclature_technique_collect(imprt: geonature.core.imports.models.TImports, entity: geonature.core.imports.models.Entity, source_status_field: geonature.core.imports.models.BibFields, technical_precision_field: geonature.core.imports.models.BibFields) None [source]#
Check the nomenclature source status and raise an error if the status is « Autre, préciser » whereas technical precision field is empty.
Parameters#
- imprtTImports
The import to check.
- entityEntity
The entity to check.
- source_status_fieldBibFields
The field representing the source status.
- technical_precision_fieldBibFields
The field representing the technical precision.
Notes#
- The error codes are:
CONDITIONAL_MANDATORY_FIELD_ERROR: the field is mandatory and not set.