people.models.membership

Classes

AgencyMembership

A membership to an agency.

Module Contents

class people.models.membership.AgencyMembership[source]

Bases: onegov.core.orm.Base, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.search.ORMSearchable, onegov.core.orm.mixins.UTCPublicationMixin

A membership to an agency.

__tablename__ = 'agency_memberships'[source]
type: Column[str][source]
__mapper_args__[source]
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]

Returns the type mapping of this model. Each property in the mapping will be read from the model instance.

The returned object needs to be a dict or an object that provides a to_dict method.

Internally, onegov.search stores differing languages in different indices. It does this automatically through langauge detection, or by manually specifying a language.

Note that objects with multiple languages are not supported (each object is supposed to have exactly one language).

Onegov.search will automatically insert the right analyzer for types like these.

There’s currently only limited support for properties here, namely objects and nested mappings do not work! This is going to be added in the future though.

id: Column[uuid.UUID][source]
agency_id: Column[int][source]
agency: relationship[Agency][source]
person_id: Column[uuid.UUID][source]
person: relationship[Person][source]
order_within_agency: Column[int][source]
order_within_person: Column[int][source]
title: Column[str][source]
since: Column[str | None][source]
property siblings_by_agency: Query[Self][source]

Returns a query that includes all siblings by agency, including the item itself ordered by order_within_agency.

property siblings_by_person: Query[Self][source]

Returns a query that includes all siblings by person, including the item itself ordered by order_within_person.

vcard(exclude: Collection[str] | None = None) str[source]

Returns the person as vCard (3.0).

Allows to specify the included attributes, provides a reasonable default if none are specified. Always includes the first and last name.