pas.collections.attendence

Classes

AttendenceCollection

Abstract base class for generic types.

Module Contents

class pas.collections.attendence.AttendenceCollection(session: sqlalchemy.orm.Session, settlement_run_id: str | None = None, date_from: date | None = None, date_to: date | None = None, type: str | None = None, parliamentarian_id: str | None = None, commission_id: str | None = None, party_id: str | None = None)[source]

Bases: onegov.core.collection.GenericCollection[onegov.pas.models.Attendence]

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:
    try:
        return mapping[key]
    except KeyError:
        return default
settlement_run_id = None[source]
date_from = None[source]
date_to = None[source]
type = None[source]
parliamentarian_id = None[source]
commission_id = None[source]
party_id = None[source]
property model_class: type[onegov.pas.models.Attendence][source]
query() Query[Attendence][source]
for_filter(settlement_run_id: str | None = None, date_from: date | None = None, date_to: date | None = None, type: str | None = None, parliamentarian_id: str | None = None, commission_id: str | None = None, party_id: str | None = None) Self[source]
by_party(party_id: str, start_date: datetime.date, end_date: datetime.date) Self[source]

Filter attendances by party membership during a period. Returns attendances where the parliamentarian belonged to the party at any point during the period.