geonature.core.imports.checks.sql.user

Classes

Functions

user_matching(imprt, field)

Find matching user for a given transient table and csv column.

map_observer_matching(imprt, entity, observer_field)

Module Contents

class geonature.core.imports.checks.sql.user.UserMatchingSchema[source]

Bases: marshmallow.Schema

user_to_match[source]
id_role[source]
identifiant[source]
nom_complet[source]
geonature.core.imports.checks.sql.user.user_matching(imprt: geonature.core.imports.models.TImports, field: geonature.core.imports.models.BibFields)[source]

Find matching user for a given transient table and csv column.

Parameters

imprtTImports

The import object which contains the transient table.

fieldBibFields

field use to fetch user name strings

Returns

dict

A dictionary of users name (as it appears in the source file) as key and a dictionary of matching information as value. The matching information contains id_role, identifiant, nom_complet.

Notes

The matching is done by computing the similarity between the source file usernames and the nom_complet of the users in the utilisateurs.t_roles table.

geonature.core.imports.checks.sql.user.map_observer_matching(imprt: geonature.core.imports.models.TImports, entity: geonature.core.imports.models.Entity, observer_field: geonature.core.imports.models.BibFields)[source]