feriennet.collections.activity
Attributes
Classes
Provides a pagination that supports loading multiple pages at once. |
Module Contents
- class feriennet.collections.activity.VacationActivityCollection(session: sqlalchemy.orm.Session, type: None = None, pages: tuple[int, int] | None = (0, 0), filter: ActivityFilter | None = None, identity: Identity | NoIdentity | None = None)[source]
Bases:
onegov.activity.ActivityCollection
[onegov.feriennet.models.VacationActivity
]Provides a pagination that supports loading multiple pages at once.
This is useful in a context where a single button is used to ‘load more’ results one by one. In this case we need an URL that represents what’s happening on the screen (multiple pages are shown at the same time).
- transform_batch_query(query: Query[T]) Query[T] [source]
Allows subclasses to transform the given query before it is used to retrieve the batch. This is a good place to add additional loading that should only apply to the batch (say joining other values to the batch which are then not loaded by the whole query).
- query_base() Query[VacationActivity] [source]
Returns the query based used by
query()
. Overriding this function is useful to apply a general filter to the query before any other filter is applied.For example, a policy can be enforced that only allows public activites.