people.models.agency ==================== .. py:module:: people.models.agency Attributes ---------- .. autoapisummary:: people.models.agency.AgencySortKey Classes ------- .. autoapisummary:: people.models.agency.AgencyOrganigram people.models.agency.Agency Module Contents --------------- .. py:type:: AgencySortKey :canonical: Callable[['Agency'], SupportsRichComparison] .. py:class:: AgencyOrganigram Bases: :py:obj:`onegov.file.File` A general file (image, document, pdf, etc), referenced in the database. Thanks to the use of `Depot `_ files can be seemingly stored in the database (with transaction guarantees), without actually storing it in the database. .. py:attribute:: __mapper_args__ .. py:class:: Agency(title: str, parent: Self | None = None, **kwargs: Any) Bases: :py:obj:`onegov.core.orm.abstract.AdjacencyList`, :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`, :py:obj:`onegov.gis.CoordinatesMixin` An agency (organization) containing people through memberships. .. py:attribute:: __tablename__ :value: 'agencies' .. 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:: description :type: sqlalchemy.Column[str | None] .. py:attribute:: portrait :type: sqlalchemy.Column[markupsafe.Markup | None] .. py:attribute:: location_address :type: sqlalchemy.Column[str | None] .. py:attribute:: location_code_city :type: sqlalchemy.Column[str | None] .. py:attribute:: postal_address :type: sqlalchemy.Column[str | None] .. py:attribute:: postal_code_city :type: sqlalchemy.Column[str | None] .. py:attribute:: phone :type: sqlalchemy.Column[str | None] .. py:attribute:: phone_direct :type: sqlalchemy.Column[str | None] .. py:attribute:: email :type: sqlalchemy.Column[str | None] .. py:attribute:: website :type: sqlalchemy.Column[str | None] .. py:attribute:: opening_hours :type: sqlalchemy.Column[str | None] .. py:attribute:: organigram :value: None .. py:attribute:: memberships :type: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[onegov.people.models.membership.AgencyMembership]] .. py:attribute:: parent :type: sqlalchemy.orm.relationship[Agency | None] .. py:property:: organigram_file :type: depot.io.interfaces.StoredFile | None Returns the file-like content of the organigram. .. py:method:: add_person(person_id: uuid.UUID, title: str, *, order_within_agency: int = 2**16, **kwargs: Any) -> None Appends a person to the agency with the given title. .. py:method:: sort_children(sortkey: AgencySortKey | None = None) -> None Sorts the suborganizations. Sorts by the agency title by default. .. py:method:: sort_relationships(sortkey: AgencyMembershipSortKey | None = None) -> None Sorts the relationships. Sorts by last name, first name.by default.