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:: fts_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:: fts_properties .. py:property:: fts_last_change :type: None Returns the date the document was created/last modified. .. 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) -> onegov.people.models.membership.AgencyMembership 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.