pay.collections.payable

Attributes

_P

Classes

PayableCollection

Provides a collection of all payable models. This collection is

Module Contents

pay.collections.payable._P[source]
class pay.collections.payable.PayableCollection(session: sqlalchemy.orm.Session, cls: type[_P], page: int = 0)[source]
class pay.collections.payable.PayableCollection(session: sqlalchemy.orm.Session, cls: Literal['*'] = '*', page: int = 0)

Bases: onegov.core.collection.Pagination[_P]

Provides a collection of all payable models. This collection is meant to be read-only, so there’s no add/delete methods.

To add payments to payable models just use the payment property and directly assign a new or an existing payment.

page: int[source]
session[source]
cls = '*'[source]
transform_batch_query(query: QueryChain[_P]) QueryChain[_P][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).

property classes: tuple[type[onegov.core.orm.Base], Ellipsis][source]
query() QueryChain[_P][source]
__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() QueryChain[_P][source]

Returns an SQLAlchemy query containing all records that should be considered for pagination.

property page_index: int[source]

Returns the current page index (starting at 0).

page_by_index(index: int) Self[source]

Returns the page at the given index. A page here means an instance of the class inheriting from the Pagination base class.