org.models.political_business

Attributes

PoliticalBusinessType

PoliticalBusinessStatus

POLITICAL_BUSINESS_TYPE

POLITICAL_BUSINESS_STATUS

Classes

PoliticalBusiness

Extends any class that has a meta dictionary field with the ability to

PoliticalBusinessParticipation

A participant of a political business, e.g. a parliamentarian.

PoliticalBusinessCollection

Abstract base class for generic types.

PoliticalBusinessParticipationCollection

Abstract base class for generic types.

Module Contents

type org.models.political_business.PoliticalBusinessType = Literal['inquiry', 'report and proposal', 'urgent interpellation', 'invitation', 'interpellation', 'commission report', 'motion', 'postulate', 'resolution', 'election', 'parliamentary statement', 'miscellaneous'][source]
type org.models.political_business.PoliticalBusinessStatus = Literal['abgeschrieben', 'beantwortet', 'erheblich_erklaert', 'erledigt', 'nicht_erheblich_erklaert', 'nicht_zustandegekommen', 'pendent_exekutive', 'pendent_legislative', 'rueckzug', 'umgewandelt', 'zurueckgewiesen', 'ueberwiesen'][source]
org.models.political_business.POLITICAL_BUSINESS_TYPE: dict[PoliticalBusinessType, str][source]
org.models.political_business.POLITICAL_BUSINESS_STATUS: dict[PoliticalBusinessStatus, str][source]
class org.models.political_business.PoliticalBusiness[source]

Bases: onegov.org.models.extensions.AccessExtension, onegov.file.MultiAssociatedFiles, onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.org.models.extensions.GeneralFileLinkExtension, onegov.search.ORMSearchable

Extends any class that has a meta dictionary field with the ability to set one of the following access levels:

  • ‘public’ - The default, the model is listed and accessible.

  • ‘private’ - Neither listed nor accessible, except administrators

    and editors.

  • ‘member’ - Neither listed nor accessible except administrators, editors

    and members.

  • ‘secret’ - Not listed, but available for anyone that knows the URL.

  • ‘mtan’ - The model is listed but only accessible once an mTAN has been

    sent to the person and entered correctly.

  • ‘secret_mtan’ - Not listed and only accessible once an mTAN has been

    sent to the person and entered correctly.

see onegov.core.security.rules.has_permission_not_logged_in()

GERMAN_STATUS_NAME_TO_VALUE_MAP: dict[str, str][source]
__tablename__ = 'par_political_businesses'[source]
es_type_name = 'ris_political_business'[source]

Returns the unique type name of the model.

es_public = True[source]

Returns True if the model is available to be found by the public. If false, only editors/admins will see this object in the search results.

es_properties[source]
property es_suggestion: str[source]

Returns suggest-as-you-type value of the document. The field used for this property should also be indexed, or the suggestion will lead to nowhere.

If a single string is returned, the completion input equals the completion output. (My Title -> My Title)

If an array of strings is returned, all values are possible inputs and the first value is the output. (My Title/Title My -> My Title)

id: sqlalchemy.Column[uuid.UUID][source]
title: sqlalchemy.Column[str][source]
number: sqlalchemy.Column[str | None][source]
political_business_type: sqlalchemy.Column[PoliticalBusinessType][source]
status: sqlalchemy.Column[PoliticalBusinessStatus | None][source]
entry_date: sqlalchemy.Column[datetime.date | None][source]
participants: sqlalchemy.orm.relationship[list[PoliticalBusinessParticipation]][source]
parliamentary_group_id: sqlalchemy.Column[uuid.UUID | None][source]
parliamentary_group: sqlalchemy.orm.relationship[onegov.org.models.RISParliamentaryGroup | None][source]
meetings: sqlalchemy.orm.relationship[onegov.org.models.Meeting][source]
meeting_items: sqlalchemy.orm.relationship[list[onegov.org.models.MeetingItem]][source]
display_name() str[source]
__repr__() str[source]
class org.models.political_business.PoliticalBusinessParticipation[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin

A participant of a political business, e.g. a parliamentarian.

__tablename__ = 'par_political_business_participants'[source]
id: sqlalchemy.Column[uuid.UUID][source]
political_business_id: sqlalchemy.Column[uuid.UUID][source]
parliamentarian_id: sqlalchemy.Column[uuid.UUID][source]
participant_type: sqlalchemy.Column[str | None][source]
political_business: sqlalchemy.orm.relationship[PoliticalBusiness][source]
parliamentarian: sqlalchemy.orm.relationship[onegov.org.models.RISParliamentarian][source]
__repr__() str[source]
class org.models.political_business.PoliticalBusinessCollection(session: sqlalchemy.orm.Session, page: int = 0, status: collections.abc.Collection[PoliticalBusinessStatus] | None = None, types: collections.abc.Collection[PoliticalBusinessType] | None = None, years: collections.abc.Collection[int] | None = None)[source]

Bases: onegov.core.collection.GenericCollection[PoliticalBusiness], onegov.core.collection.Pagination[PoliticalBusiness]

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
page = 0[source]
status[source]
types[source]
years[source]
batch_size = 20[source]
property model_class: type[PoliticalBusiness][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.

query() sqlalchemy.orm.Query[PoliticalBusiness][source]
subset() sqlalchemy.orm.Query[PoliticalBusiness][source]

Returns an SQLAlchemy query containing all records that should be considered for pagination.

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.

property page_index: int[source]

Returns the current page index (starting at 0).

for_filter(status: PoliticalBusinessStatus | None = None, type: PoliticalBusinessType | None = None, year: int | None = None) Self[source]
years_for_entries() list[int][source]

Returns a list of years for which there are entries in the db

by_display_name(display_name: str) PoliticalBusiness | None[source]

Returns the given political business by display name or None.

class org.models.political_business.PoliticalBusinessParticipationCollection(session: sqlalchemy.orm.Session, active: bool | None = None)[source]

Bases: onegov.core.collection.GenericCollection[PoliticalBusinessParticipation]

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
active = None[source]
property model_class: type[PoliticalBusinessParticipation][source]
by_parliamentarian_id(parliamentarian_id: uuid.UUID) sqlalchemy.orm.Query[PoliticalBusinessParticipation][source]