Manages the payment records.

Module Contents

class pay.collections.payment.PaymentCollection(session: sqlalchemy.orm.Session, source: str = '*', page: int = 0, start: datetime | None = None, end: datetime | None = None)[source]

Bases: onegov.core.collection.GenericCollection[], onegov.core.collection.Pagination[]

Manages the payment records.

To render a list of payments you might want to also consider the collection, which renders payments by loading the linked records first.

page: int[source]
property model_class: type[][source]
add(*, source: str | None = None, amount: Decimal | None = None, currency: str = 'CHF', remote_id: str | None = None, state: = 'open', **kwargs: Any)[source]
__eq__(other: object) bool[source]

Return self==value.

subset() Query[Payment][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) typing_extensions.Self[source]

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

A more efficient way of loading all links of the given batch (compared to loading payment.links one by one).