pas.models.parliamentarian

Classes

PASParliamentarian

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded

Module Contents

class pas.models.parliamentarian.PASParliamentarian[source]

Bases: onegov.parliament.models.Parliamentarian, onegov.search.ORMSearchable

Mixin providing a meta/content JSON pair. Meta is a JSON column loaded with each request, content is a JSON column loaded deferred (to be shown only in the detail view).

__mapper_args__[source]
es_type_name = 'pas_parliamentarian'[source]

Returns the unique type name of the model.

es_public = False[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: tuple[str, Ellipsis][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)

attendences: sqlalchemy.orm.relationship[list[onegov.pas.models.Attendence]][source]
user: sqlalchemy.orm.relationship[onegov.user.User][source]
roles: sqlalchemy.orm.relationship[list[onegov.pas.models.parliamentarian_role.PASParliamentarianRole]][source]
get_party_during_period(start_date: datetime.date, end_date: datetime.date, session: sqlalchemy.orm.Session) onegov.pas.models.Party | None[source]

Get the party this parliamentarian belonged to during a specific period.

Note: If you find yourself calling this in a loop, it’s not

recommended. Pre-fetch PASParliamentarianRole first.