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

people.models.agency.AgencySortKey: TypeAlias = 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: 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.

description: Column[str | None][source]
portrait: Column[Markup | None][source]
location_address: Column[str | None][source]
location_code_city: Column[str | None][source]
postal_address: Column[str | None][source]
postal_code_city: Column[str | None][source]
phone: Column[str | None][source]
phone_direct: Column[str | None][source]
email: Column[str | None][source]
website: Column[str | None][source]
opening_hours: Column[str | None][source]
organigram[source]
memberships: relationship[AppenderQuery[AgencyMembership]][source]
parent: sqlalchemy.orm.relationship[Agency | None][source]
property organigram_file: 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) None[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.