winterthur.collections.mission_report
Classes
Manages files. |
|
Provides collections with pagination, if they implement a few |
|
Module Contents
- class winterthur.collections.mission_report.MissionReportFileCollection(session: sqlalchemy.orm.Session, report: onegov.winterthur.models.MissionReport)[source]
Bases:
onegov.org.models.file.BaseImageFileCollection[onegov.winterthur.models.MissionReportFile]Manages files.
- Parameters:
session – The SQLAlchemy db session to use.
type – The polymorphic type to use and to filter for, or ‘*’ for all.
allow_duplicates –
Prevents duplicates if set to false. Duplicates are detected before pre-processing, so already stored files may be downloaded and added again, as they might have changed during the upload.
Note that this does not change existing files. It only prevents new duplicates from being added.
- class winterthur.collections.mission_report.MissionReportCollection(session: sqlalchemy.orm.Session, page: int = 0, include_hidden: bool = False, year: int | None = None)[source]
Bases:
onegov.core.collection.GenericCollection[onegov.winterthur.models.MissionReport],onegov.core.collection.Pagination[onegov.winterthur.models.MissionReport]Provides collections with pagination, if they implement a few documented properties and methods.
See
onegov.ticket.TicketCollectionfor an example.- __eq__(other: object) bool[source]
Returns True if the current and the other Pagination instance are equal. Used to find the current page in a list of pages.
- subset() sqlalchemy.orm.Query[onegov.winterthur.models.MissionReport][source]
Returns an SQLAlchemy query containing all records that should be considered for pagination.