geonature.core.gn_meta.models

Submodules

Attributes

Classes

Functions

get_scopes_by_action([id_role, module_code, object_code])

This function gets the scopes permissions for each one of the 6 actions in "CRUVED",

get_scopes_by_action([id_role, module_code, object_code])

This function gets the scopes permissions for each one of the 6 actions in "CRUVED",

Package Contents

geonature.core.gn_meta.models.get_scopes_by_action(id_role=None, module_code=None, object_code=None)[source]

This function gets the scopes permissions for each one of the 6 actions in « CRUVED », that match (id_role, module_code, object_code)

:returns : (dict) A dict of the scope for each one of the 6 actions (the char in « CRUVED »)

class geonature.core.gn_meta.models.TDatasets[source]

Bases: geonature.core.gn_meta.models.commons.db.Model

__tablename__ = 't_datasets'
__table_args__
id_dataset
unique_dataset_id
id_acquisition_framework
acquisition_framework
dataset_name
dataset_shortname
dataset_desc
id_nomenclature_data_type
keywords
marine_domain
terrestrial_domain
id_nomenclature_dataset_objectif
bbox_west
bbox_east
bbox_south
bbox_north
id_nomenclature_collecting_method
id_nomenclature_data_origin
id_nomenclature_source_status
id_nomenclature_resource_type
meta_create_date
meta_update_date
active
validable
id_digitizer
digitizer
creator
id_taxa_list
modules
nomenclature_data_type
nomenclature_dataset_objectif
nomenclature_collecting_method
nomenclature_data_origin
nomenclature_source_status
nomenclature_resource_type
cor_territories
cor_dataset_actor
additional_fields
user_actors()[source]
organism_actors()[source]
is_deletable()[source]
has_instance_permission(scope, _through_af=True)[source]

_through_af prevent infinite recursion

__str__()[source]
static get_id(uuid_dataset)[source]
static get_uuid(id_dataset)[source]
classmethod _get_read_scope(user=None)[source]
classmethod _get_create_scope(module_code, user=None, object_code=None)[source]
filter_by_scope(scope, *, query, user=None)[source]
filter_by_params(params={}, *, _af_search=True, query=None)[source]
filter_by_readable(query, user=None)[source]

Return the datasets where the user has autorization via its CRUVED

filter_by_creatable(module_code, *, query, user=None, object_code=None)[source]

Return all dataset where user have read rights minus those who user to not have create rigth

filter_by_areas(areas, *, query)[source]
class geonature.core.gn_meta.models.TAcquisitionFramework[source]

Bases: geonature.core.gn_meta.models.commons.db.Model

__tablename__ = 't_acquisition_frameworks'
__table_args__
id_acquisition_framework
unique_acquisition_framework_id
acquisition_framework_name
acquisition_framework_desc
id_nomenclature_territorial_level
territory_desc
keywords
id_nomenclature_financing_type
target_description
ecologic_or_geologic_target
acquisition_framework_parent_id
is_parent
opened
id_digitizer
acquisition_framework_start_date
acquisition_framework_end_date
meta_create_date
meta_update_date
initial_closing_date
creator
nomenclature_territorial_level
nomenclature_financing_type
cor_af_actor
cor_objectifs
cor_volets_sinp
cor_territories
bibliographical_references
t_datasets
datasets
user_actors()[source]
organism_actors()[source]
has_datasets()[source]
has_child_acquisition_framework()[source]
has_instance_permission(scope, _through_ds=True)[source]
static get_id(uuid_af)[source]

return the acquisition framework’s id from its UUID if exist or None

static get_user_af(user, only_query=False, only_user=False)[source]

get the af(s) where the user is actor (himself or with its organism - only himelsemf id only_use=True) or digitizer param:

  • user from TRole model

  • only_query: boolean (return the query not the id_datasets allowed if true)

  • only_user: boolean: return only the dataset where user himself is actor (not with its organoism)

return: a list of id_dataset or a query

classmethod _get_read_scope(user=None)[source]
filter_by_scope(scope, *, query, user=None)[source]
filter_by_readable(*, query, user=None)[source]

Return the afs where the user has autorization via its CRUVED

filter_by_areas(areas, *, query)[source]

Filter meta by areas

filter_by_params(params={}, *, _ds_search=True, query=None)[source]
geonature.core.gn_meta.models.MIN_LENGTH_UUID_OR_DATE_SEARCH_STRING = 5[source]
class geonature.core.gn_meta.models.DateFilterSchema[source]

Bases: marshmallow.Schema

year
month
day
class geonature.core.gn_meta.models.MetadataFilterSchema[source]

Bases: marshmallow.Schema

class Meta
unknown
uuid
name
date
person
organism
areas
search
convert_date(data, **kwargs)[source]
geonature.core.gn_meta.models.cor_acquisition_framework_objectif[source]
geonature.core.gn_meta.models.cor_acquisition_framework_voletsinp[source]
geonature.core.gn_meta.models.cor_acquisition_framework_territory[source]
class geonature.core.gn_meta.models.CorAcquisitionFrameworkActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_acquisition_framework_actor'
__table_args__
id_cafa
id_acquisition_framework
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
class geonature.core.gn_meta.models.CorDatasetActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_actor'
__table_args__
id_cda
id_dataset
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
actor()[source]
display()[source]
class geonature.core.gn_meta.models.CorDatasetProtocol[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_protocol'
__table_args__
id_cdp
id_dataset
id_protocol
geonature.core.gn_meta.models.cor_dataset_territory[source]
class geonature.core.gn_meta.models.TBibliographicReference[source]

Bases: geonature.utils.env.db.Model

__tablename__ = 't_bibliographical_references'
__table_args__
id_bibliographic_reference
id_acquisition_framework
publication_url
publication_reference
geonature.core.gn_meta.models.get_scopes_by_action(id_role=None, module_code=None, object_code=None)[source]

This function gets the scopes permissions for each one of the 6 actions in « CRUVED », that match (id_role, module_code, object_code)

:returns : (dict) A dict of the scope for each one of the 6 actions (the char in « CRUVED »)

class geonature.core.gn_meta.models.TDatasets[source]

Bases: geonature.core.gn_meta.models.commons.db.Model

__tablename__ = 't_datasets'
__table_args__
id_dataset
unique_dataset_id
id_acquisition_framework
acquisition_framework
dataset_name
dataset_shortname
dataset_desc
id_nomenclature_data_type
keywords
marine_domain
terrestrial_domain
id_nomenclature_dataset_objectif
bbox_west
bbox_east
bbox_south
bbox_north
id_nomenclature_collecting_method
id_nomenclature_data_origin
id_nomenclature_source_status
id_nomenclature_resource_type
meta_create_date
meta_update_date
active
validable
id_digitizer
digitizer
creator
id_taxa_list
modules
nomenclature_data_type
nomenclature_dataset_objectif
nomenclature_collecting_method
nomenclature_data_origin
nomenclature_source_status
nomenclature_resource_type
cor_territories
cor_dataset_actor
additional_fields
user_actors()[source]
organism_actors()[source]
is_deletable()[source]
has_instance_permission(scope, _through_af=True)[source]

_through_af prevent infinite recursion

__str__()[source]
static get_id(uuid_dataset)[source]
static get_uuid(id_dataset)[source]
classmethod _get_read_scope(user=None)[source]
classmethod _get_create_scope(module_code, user=None, object_code=None)[source]
filter_by_scope(scope, *, query, user=None)[source]
filter_by_params(params={}, *, _af_search=True, query=None)[source]
filter_by_readable(query, user=None)[source]

Return the datasets where the user has autorization via its CRUVED

filter_by_creatable(module_code, *, query, user=None, object_code=None)[source]

Return all dataset where user have read rights minus those who user to not have create rigth

filter_by_areas(areas, *, query)[source]
geonature.core.gn_meta.models.MIN_LENGTH_UUID_OR_DATE_SEARCH_STRING = 5[source]
class geonature.core.gn_meta.models.DateFilterSchema[source]

Bases: marshmallow.Schema

year
month
day
class geonature.core.gn_meta.models.MetadataFilterSchema[source]

Bases: marshmallow.Schema

class Meta
unknown
uuid
name
date
person
organism
areas
search
convert_date(data, **kwargs)[source]
geonature.core.gn_meta.models.cor_acquisition_framework_objectif[source]
geonature.core.gn_meta.models.cor_acquisition_framework_voletsinp[source]
geonature.core.gn_meta.models.cor_acquisition_framework_territory[source]
class geonature.core.gn_meta.models.CorAcquisitionFrameworkActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_acquisition_framework_actor'
__table_args__
id_cafa
id_acquisition_framework
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
class geonature.core.gn_meta.models.CorDatasetActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_actor'
__table_args__
id_cda
id_dataset
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
actor()[source]
display()[source]
class geonature.core.gn_meta.models.CorDatasetProtocol[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_protocol'
__table_args__
id_cdp
id_dataset
id_protocol
geonature.core.gn_meta.models.cor_dataset_territory[source]
class geonature.core.gn_meta.models.TBibliographicReference[source]

Bases: geonature.utils.env.db.Model

__tablename__ = 't_bibliographical_references'
__table_args__
id_bibliographic_reference
id_acquisition_framework
publication_url
publication_reference
geonature.core.gn_meta.models.MIN_LENGTH_UUID_OR_DATE_SEARCH_STRING = 5[source]
class geonature.core.gn_meta.models.DateFilterSchema[source]

Bases: marshmallow.Schema

year
month
day
class geonature.core.gn_meta.models.MetadataFilterSchema[source]

Bases: marshmallow.Schema

class Meta
unknown
uuid
name
date
person
organism
areas
search
convert_date(data, **kwargs)[source]
geonature.core.gn_meta.models.cor_acquisition_framework_objectif[source]
geonature.core.gn_meta.models.cor_acquisition_framework_voletsinp[source]
geonature.core.gn_meta.models.cor_acquisition_framework_territory[source]
class geonature.core.gn_meta.models.CorAcquisitionFrameworkActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_acquisition_framework_actor'
__table_args__
id_cafa
id_acquisition_framework
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
class geonature.core.gn_meta.models.CorDatasetActor[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_actor'
__table_args__
id_cda
id_dataset
id_role
id_organism
id_nomenclature_actor_role
nomenclature_actor_role
role
organism
actor()[source]
display()[source]
class geonature.core.gn_meta.models.CorDatasetProtocol[source]

Bases: geonature.utils.env.DB.Model

__tablename__ = 'cor_dataset_protocol'
__table_args__
id_cdp
id_dataset
id_protocol
geonature.core.gn_meta.models.cor_dataset_territory[source]
class geonature.core.gn_meta.models.TBibliographicReference[source]

Bases: geonature.utils.env.db.Model

__tablename__ = 't_bibliographical_references'
__table_args__
id_bibliographic_reference
id_acquisition_framework
publication_url
publication_reference