pas.collections.parliamentarian

Attributes

log

Classes

PASParliamentarianCollection

Abstract base class for generic types.

Module Contents

pas.collections.parliamentarian.log[source]
class pas.collections.parliamentarian.PASParliamentarianCollection(app: onegov.core.Framework, **kwargs: Any)[source]

Bases: onegov.parliament.collections.ParliamentarianCollection[onegov.pas.models.PASParliamentarian]

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
app[source]
for_filter(active: bool | None = None, party: str | None = None) Self[source]
property model_class: type[onegov.pas.models.PASParliamentarian][source]
add(**kwargs: Any) onegov.pas.models.PASParliamentarian[source]
delete(item: onegov.pas.models.PASParliamentarian) None[source]
_is_current_commission_president(item: onegov.pas.models.PASParliamentarian) bool[source]

Check if the parliamentarian is currently a president of any commission.

update_user(item: onegov.pas.models.PASParliamentarian, new_email: str | None) None[source]

Keep the parliamentarian and its user account in sync.

  • Creates a new user account if an email address is set (if not already existing).

  • Disable user accounts if an email has been deleted.

  • Change usernames if an email has changed.

  • Make sure used user accounts have the right role.

  • Make sure used user accounts are activated.

  • Make sure the password is changed if activated or disabled.