geonature.core.gn_meta.models.commons

Module Contents

Classes

DateFilterSchema

Base schema class with which to define custom schemas.

MetadataFilterSchema

Base schema class with which to define custom schemas.

CorAcquisitionFrameworkActor

The base class of the SQLAlchemy.Model declarative model class.

CorDatasetActor

The base class of the SQLAlchemy.Model declarative model class.

CorDatasetProtocol

The base class of the SQLAlchemy.Model declarative model class.

TBibliographicReference

The base class of the SQLAlchemy.Model declarative model class.

Attributes

cor_acquisition_framework_objectif

cor_acquisition_framework_voletsinp

cor_acquisition_framework_territory

cor_dataset_territory

class geonature.core.gn_meta.models.commons.DateFilterSchema(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.Schema

Base schema class with which to define custom schemas.

Example usage:

import datetime as dt
from dataclasses import dataclass

from marshmallow import Schema, fields


@dataclass
class Album:
    title: str
    release_date: dt.date


class AlbumSchema(Schema):
    title = fields.Str()
    release_date = fields.Date()


album = Album("Beggars Banquet", dt.date(1968, 12, 6))
schema = AlbumSchema()
data = schema.dump(album)
data  # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
Paramètres:
  • only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.

  • exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.

  • many – Should be set to True if obj is a collection so that the object will be serialized to a list.

  • context – Optional context passed to fields.Method and fields.Function fields.

  • load_only – Fields to skip during serialization (write-only fields)

  • dump_only – Fields to skip during deserialization (read-only fields)

  • partial – Whether to ignore missing fields and not require any fields declared. Propagates down to Nested fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.

  • unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.

Modifié dans la version 3.0.0: prefix parameter removed.

Modifié dans la version 2.0.0: __validators__, __preprocessors__, and __data_handlers__ are removed in favor of marshmallow.decorators.validates_schema, marshmallow.decorators.pre_load and marshmallow.decorators.post_dump. __accessor__ and __error_handler__ are deprecated. Implement the handle_error and get_attribute methods instead.

year[source]
month[source]
day[source]
class geonature.core.gn_meta.models.commons.MetadataFilterSchema(*, only: marshmallow.types.StrSequenceOrSet | None = None, exclude: marshmallow.types.StrSequenceOrSet = (), many: bool = False, context: dict | None = None, load_only: marshmallow.types.StrSequenceOrSet = (), dump_only: marshmallow.types.StrSequenceOrSet = (), partial: bool | marshmallow.types.StrSequenceOrSet | None = None, unknown: str | None = None)[source]

Bases: marshmallow.Schema

Base schema class with which to define custom schemas.

Example usage:

import datetime as dt
from dataclasses import dataclass

from marshmallow import Schema, fields


@dataclass
class Album:
    title: str
    release_date: dt.date


class AlbumSchema(Schema):
    title = fields.Str()
    release_date = fields.Date()


album = Album("Beggars Banquet", dt.date(1968, 12, 6))
schema = AlbumSchema()
data = schema.dump(album)
data  # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'}
Paramètres:
  • only – Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters.

  • exclude – Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only and exclude, it is not used. Nested fields can be represented with dot delimiters.

  • many – Should be set to True if obj is a collection so that the object will be serialized to a list.

  • context – Optional context passed to fields.Method and fields.Function fields.

  • load_only – Fields to skip during serialization (write-only fields)

  • dump_only – Fields to skip during deserialization (read-only fields)

  • partial – Whether to ignore missing fields and not require any fields declared. Propagates down to Nested fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields.

  • unknown – Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE, INCLUDE or RAISE.

Modifié dans la version 3.0.0: prefix parameter removed.

Modifié dans la version 2.0.0: __validators__, __preprocessors__, and __data_handlers__ are removed in favor of marshmallow.decorators.validates_schema, marshmallow.decorators.pre_load and marshmallow.decorators.post_dump. __accessor__ and __error_handler__ are deprecated. Implement the handle_error and get_attribute methods instead.

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

Bases: geonature.utils.env.DB.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

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

Bases: geonature.utils.env.DB.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

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

Bases: geonature.utils.env.DB.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

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

Bases: geonature.utils.env.db.Model

The base class of the SQLAlchemy.Model declarative model class.

To define models, subclass db.Model, not this. To customize db.Model, subclass this and pass it as model_class to SQLAlchemy. To customize db.Model at the metaclass level, pass an already created declarative model class as model_class.

__tablename__ = 't_bibliographical_references'[source]
__table_args__[source]
id_bibliographic_reference[source]
id_acquisition_framework[source]
publication_url[source]
publication_reference[source]