feriennet.collections.activity

Attributes

T

Classes

VacationActivityCollection

Provides a pagination that supports loading multiple pages at once.

Module Contents

feriennet.collections.activity.T[source]
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).

identity = None[source]
property policy: onegov.feriennet.policy.ActivityQueryPolicy[source]
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.

by_page_range(page_range: tuple[int, int] | None) Self[source]

Returns an instance of the collection limited to the given page range.