winterthur.models.mission_report

Attributes

MissionType

MISSION_TYPES

Classes

MissionReportFile

A general file (image, document, pdf, etc), referenced in the database.

MissionReport

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded

MissionReportVehicle

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded

MissionReportVehicleUse

Many to many association between vehicles and reports.

Module Contents

winterthur.models.mission_report.MissionType: TypeAlias = Literal['single', 'multi'][source]
winterthur.models.mission_report.MISSION_TYPES: tuple[MissionType, Ellipsis] = ('single', 'multi')[source]
class winterthur.models.mission_report.MissionReportFile[source]

Bases: onegov.file.File

A general file (image, document, pdf, etc), referenced in the database.

Thanks to the use of Depot files can be seemingly stored in the database (with transaction guarantees), without actually storing it in the database.

__mapper_args__[source]
class winterthur.models.mission_report.MissionReport[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.org.models.AccessExtension

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded with each request, content is a JSON column loaded deferred (to be shown only in the detail view).

__tablename__ = 'mission_reports'[source]
id: Column[uuid.UUID][source]
date: Column[datetime][source]
duration: Column[Decimal][source]
nature: Column[str][source]
location: Column[str][source]
personnel: Column[int][source]
backup: Column[int][source]
civil_defence: Column[bool][source]
pictures = None[source]
mission_count: Column[int][source]
mission_type: Column[MissionType][source]
used_vehicles: relationship[list[MissionReportVehicleUse]][source]
property title: str[source]
property readable_duration: str[source]
property local_date: datetime.datetime[source]
class winterthur.models.mission_report.MissionReportVehicle[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.org.models.AccessExtension

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded with each request, content is a JSON column loaded deferred (to be shown only in the detail view).

__tablename__ = 'mission_report_vehicles'[source]
id: Column[uuid.UUID][source]
name: Column[str][source]
description: Column[str][source]
symbol = None[source]
website: Column[str | None][source]
uses: relationship[list[MissionReportVehicleUse]][source]
property title: str[source]
property readable_website: str | None[source]
class winterthur.models.mission_report.MissionReportVehicleUse[source]

Bases: onegov.core.orm.Base

Many to many association between vehicles and reports.

__tablename__ = 'mission_report_vehicle_usees'[source]
mission_report_id: Column[uuid.UUID][source]
mission_report: relationship[MissionReport][source]
vehicle_id: Column[uuid.UUID][source]
vehicle: relationship[MissionReportVehicle][source]
count[source]