geonature.core.gn_meta.mtd.mtd_utils

Module Contents

Functions

sync_ds(ds, cd_nomenclatures)

Will create or update a given DS according to UUID.

sync_af(af)

Will create or update a given AF according to UUID.

add_or_update_organism(uuid, nom, email)

Create or update organism if UUID not exists in DB.

associate_actors(actors, CorActor, pk_name, pk_value)

Associate actor and DS or AF according to CorActor value.

associate_dataset_modules(dataset)

Associate a dataset to modules specified in [MTD][JDD_MODULE_CODE_ASSOCIATION] parameter (geonature config)

Attributes

NOMENCLATURE_MAPPING

log

geonature.core.gn_meta.mtd.mtd_utils.NOMENCLATURE_MAPPING[source]
geonature.core.gn_meta.mtd.mtd_utils.log[source]
geonature.core.gn_meta.mtd.mtd_utils.sync_ds(ds, cd_nomenclatures)[source]

Will create or update a given DS according to UUID. Only process DS if dataset’s cd_nomenclatures exists in ref_normenclatures.t_nomenclatures.

Paramètres:
  • ds – <dict> DS infos

  • cd_nomenclatures – <array> cd_nomenclature from ref_normenclatures.t_nomenclatures

geonature.core.gn_meta.mtd.mtd_utils.sync_af(af)[source]

Will create or update a given AF according to UUID.

Paramètres:

af – dict AF infos

geonature.core.gn_meta.mtd.mtd_utils.add_or_update_organism(uuid, nom, email)[source]

Create or update organism if UUID not exists in DB.

Paramètres:
  • uuid – uniq organism uuid

  • nom – org name

  • email – org email

geonature.core.gn_meta.mtd.mtd_utils.associate_actors(actors, CorActor, pk_name, pk_value)[source]

Associate actor and DS or AF according to CorActor value.

Parameters

actorslist

list of actors

CorActordb.Model

table model

pk_namestr

pk attribute name

pk_valuestr

pk value

geonature.core.gn_meta.mtd.mtd_utils.associate_dataset_modules(dataset)[source]

Associate a dataset to modules specified in [MTD][JDD_MODULE_CODE_ASSOCIATION] parameter (geonature config)

Paramètres:

dataset – <geonature.core.gn_meta.models.TDatasets> dataset (SQLAlchemy model object)