people.models.membership ======================== .. py:module:: people.models.membership Classes ------- .. autoapisummary:: people.models.membership.AgencyMembership Module Contents --------------- .. py:class:: AgencyMembership Bases: :py:obj:`onegov.core.orm.Base`, :py:obj:`onegov.core.orm.mixins.ContentMixin`, :py:obj:`onegov.core.orm.mixins.TimestampMixin`, :py:obj:`onegov.search.ORMSearchable`, :py:obj:`onegov.core.orm.mixins.UTCPublicationMixin` A membership to an agency. .. py:attribute:: __tablename__ :value: 'agency_memberships' .. py:attribute:: type :type: sqlalchemy.Column[str] .. py:attribute:: __mapper_args__ .. py:attribute:: es_public :value: True 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. .. py:attribute:: es_properties 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. .. py:attribute:: id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: agency_id :type: sqlalchemy.Column[int] .. py:attribute:: agency :type: sqlalchemy.orm.relationship[people.models.agency.Agency] .. py:attribute:: person_id :type: sqlalchemy.Column[uuid.UUID] .. py:attribute:: person :type: sqlalchemy.orm.relationship[people.models.person.Person] .. py:attribute:: order_within_agency :type: sqlalchemy.Column[int] .. py:attribute:: order_within_person :type: sqlalchemy.Column[int] .. py:attribute:: title :type: sqlalchemy.Column[str] .. py:attribute:: since :type: sqlalchemy.Column[str | None] .. py:property:: siblings_by_agency :type: sqlalchemy.orm.Query[Self] Returns a query that includes all siblings by agency, including the item itself ordered by `order_within_agency`. .. py:property:: siblings_by_person :type: sqlalchemy.orm.Query[Self] Returns a query that includes all siblings by person, including the item itself ordered by `order_within_person`. .. py:method:: vcard(exclude: collections.abc.Collection[str] | None = None) -> str 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.