Site Model#

class backend.app.models.site.Site(*, id: int | None = None, name: str | None = None, region: str | None = None, country: str, typology: str | None = None, geo_location: Point | None = None)[source]#

Bases: SQLModel

Represents a site.

This class models a site where datasets are collected.

Parameters:
  • id (int) – The unique identifier of the site.

  • name (str) – The name of the site.

  • region (str) – The region where the site is located.

  • country (str) – The country where the site is located.

  • typology (str) – The typology of the site.

  • geo_location (Point) – The geographical location of the site.

  • datasets (list[Dataset]) – The datasets associated with the site.

country: str#
datasets: Mapped[list[Dataset] | None]#
geo_location: Point | None#
id: int | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'read_from_attributes': True, 'read_with_orm_mode': True, 'registry': PydanticUndefined, 'table': True}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'country': FieldInfo(annotation=str, required=True), 'geo_location': FieldInfo(annotation=Union[Point, NoneType], required=False, default=None), 'id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'region': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'typology': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str | None#
region: str | None#
typology: str | None#
backend.app.models.site.site_after_load(target, context)[source]#
backend.app.models.site.site_before_insert(mapper, connection, target)[source]#