people.models.agency

Attributes

AgencySortKey

Classes

AgencyOrganigram

A general file (image, document, pdf, etc), referenced in the database.

Agency

An agency (organization) containing people through memberships.

Module Contents

type people.models.agency.AgencySortKey = Callable[['Agency'], SupportsRichComparison][source]
class people.models.agency.AgencyOrganigram[source]

Bases: 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.

__mapper_args__[source]
class people.models.agency.Agency(title: str, parent: Self | None = None, **kwargs: Any)[source]

Bases: onegov.core.orm.abstract.AdjacencyList, onegov.core.orm.mixins.ContentMixin, onegov.core.orm.mixins.TimestampMixin, onegov.search.ORMSearchable, onegov.core.orm.mixins.UTCPublicationMixin, onegov.gis.CoordinatesMixin

An agency (organization) containing people through memberships.

__tablename__ = 'agencies'[source]
type: sqlalchemy.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]
property es_last_change: None[source]

Returns the date the document was created/last modified.

description: sqlalchemy.Column[str | None][source]
portrait: sqlalchemy.Column[markupsafe.Markup | None][source]
location_address: sqlalchemy.Column[str | None][source]
location_code_city: sqlalchemy.Column[str | None][source]
postal_address: sqlalchemy.Column[str | None][source]
postal_code_city: sqlalchemy.Column[str | None][source]
phone: sqlalchemy.Column[str | None][source]
phone_direct: sqlalchemy.Column[str | None][source]
email: sqlalchemy.Column[str | None][source]
website: sqlalchemy.Column[str | None][source]
opening_hours: sqlalchemy.Column[str | None][source]
organigram = None[source]
memberships: sqlalchemy.orm.relationship[onegov.core.types.AppenderQuery[onegov.people.models.membership.AgencyMembership]][source]
parent: sqlalchemy.orm.relationship[Agency | None][source]
property organigram_file: depot.io.interfaces.StoredFile | None[source]

Returns the file-like content of the organigram.

add_person(person_id: uuid.UUID, title: str, *, order_within_agency: int = 2**16, **kwargs: Any) onegov.people.models.membership.AgencyMembership[source]

Appends a person to the agency with the given title.

sort_children(sortkey: AgencySortKey | None = None) None[source]

Sorts the suborganizations.

Sorts by the agency title by default.

sort_relationships(sortkey: AgencyMembershipSortKey | None = None) None[source]

Sorts the relationships.

Sorts by last name, first name.by default.