pay.collections.payment

Classes

PaymentCollection

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.pay.models.Payment], onegov.core.collection.Pagination[onegov.pay.models.Payment]

Manages the payment records.

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

page: int[source]
source[source]
start[source]
end[source]
property model_class: type[onegov.pay.models.Payment][source]
add(*, source: str | None = None, amount: Decimal | None = None, currency: str = 'CHF', remote_id: str | None = None, state: onegov.pay.types.PaymentState = 'open', **kwargs: Any) onegov.pay.models.Payment[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() 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) 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).