geonature.core.gn_permissions.schemas

Classes

PermActionSchema

PermObjectSchema

PermissionSchema

Marchmallow-sqlalchemy behavior is to search object in database,

PermissionAvailableSchema

Module Contents

class geonature.core.gn_permissions.schemas.PermActionSchema[source]

Bases: geonature.utils.env.ma.SQLAlchemyAutoSchema

class Meta[source]
model[source]
include_fk = True[source]
class geonature.core.gn_permissions.schemas.PermObjectSchema[source]

Bases: geonature.utils.env.ma.SQLAlchemyAutoSchema

class Meta[source]
model[source]
include_fk = True[source]
class geonature.core.gn_permissions.schemas.PermissionSchema[source]

Bases: utils_flask_sqla.schema.SmartRelationshipsMixin, geonature.utils.env.ma.SQLAlchemyAutoSchema

Marchmallow-sqlalchemy behavior is to search object in database, and if not found, to create a new one. As this schema is not means to create any related object, nested fields are dump only (use the FK to set the value). For m2m fields, as it is not possible to load the FK which is in another table, we let the user provide m2m models PK, but we have validation hooks which verify that related models exists and have not been created by marchmallow-sqlalchemy.

class Meta[source]
model[source]
include_fk = True[source]
load_instance = True[source]
sqla_session[source]
dump_only = ('role', 'action', 'module', 'object')[source]
role[source]
action[source]
module[source]
object[source]
scope_value[source]
areas_filter[source]
taxons_filter[source]
validate_areas_filter(data, **kwargs)[source]
validate_taxons_filter(data, **kwargs)[source]
class geonature.core.gn_permissions.schemas.PermissionAvailableSchema[source]

Bases: utils_flask_sqla.schema.SmartRelationshipsMixin, geonature.utils.env.ma.SQLAlchemyAutoSchema

class Meta[source]
model[source]
include_fk = True[source]
load_instance = True[source]
sqla_session[source]
action[source]
module[source]
object[source]