wtfs.collections.scan_jobs
Classes
Provides collections with pagination, if they implement a few |
Module Contents
- class wtfs.collections.scan_jobs.ScanJobCollection(session: sqlalchemy.orm.Session, page: int = 0, group_id: str | None = None, from_date: date | None = None, to_date: date | None = None, type: Collection[str] | None = None, municipality_id: Collection[UUID | str] | None = None, term: str | None = None, sort_by: str | None = None, sort_order: str | None = None)[source]
Bases:
onegov.core.collection.Pagination
[onegov.wtfs.models.ScanJob
]Provides collections with pagination, if they implement a few documented properties and methods.
See
onegov.ticket.TicketCollection
for an example.- next_delivery_number(municipality_id: UUID | str | None) int [source]
Returns the next delivery number for the given municipality.
- subset() Query[ScanJob] [source]
Returns an SQLAlchemy query containing all records that should be considered for pagination.
- __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.
- property current_sort_by: str[source]
Returns the currently used sorting key.
Defaults to a reasonable value.
- property current_sort_order: str[source]
Returns the currently used sorting order.
Defaults to a reasonable value.
- sort_order_by_key(sort_by: str) str [source]
Returns the sort order by key.
Defaults to ‘unsorted’.
- property order_by: Any[source]
Returns an SqlAlchemy expression for ordering queries based on the current sorting key and ordering.