Abstract base class for generic types.

Module Contents

class activity.collections.invoice.InvoiceCollection(session: sqlalchemy.orm.Session, period_id: uuid.UUID | None = None, user_id: uuid.UUID | None = None, schema: str = 'feriennet-v1', schema_config: dict[str, Any] | None = None)[source]

Bases: onegov.core.collection.GenericCollection[onegov.activity.models.Invoice]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
        return mapping[key]
    except KeyError:
        return default
schema() onegov.activity.models.invoice_reference.Schema[source]
query(ignore_period_id: bool = False) Query[Invoice][source]
query_items() Query[InvoiceItem][source]
for_user_id(user_id: uuid.UUID | None) typing_extensions.Self[source]
for_period_id(period_id: uuid.UUID | None) typing_extensions.Self[source]
for_schema(schema: str, schema_config: dict[str, Any] | None = None) typing_extensions.Self[source]
update_attendee_name(attendee_id: uuid.UUID, attendee_name: str) None[source]
invoice() str | None[source]
username() str | None[source]
property model_class: type[onegov.activity.models.Invoice][source]
_invoice_ids() Query[tuple[UUID]][source]
_sum(condition: ColumnElement[bool]) decimal.Decimal[source]
property total_amount: decimal.Decimal[source]
property outstanding_amount: decimal.Decimal[source]
property paid_amount: decimal.Decimal[source]
unpaid_count(excluded_period_ids: Collection[UUID] | None = None) int[source]
sync() None[source]
add(period_id: uuid.UUID | None = None, user_id: uuid.UUID | None = None, flush: bool = True, optimistic: bool = False) onegov.activity.models.Invoice[source]