pay.collections.payment
¶
Module Contents¶
Classes¶
Manages the payment records. |
- 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.- 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]¶
- subset() Query[Payment] [source]¶
Returns an SQLAlchemy query containing all records that should be considered for pagination.
- 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.
- payment_links_for(items: Iterable[Payment]) dict[uuid.UUID, list[onegov.pay.types.AnyPayableBase]] [source]¶
A more efficient way of loading all links of the given batch (compared to loading payment.links one by one).