org.models.directory

Attributes

ExtendedDirectorySearchWidget

Classes

DirectorySubmissionAction

ExtendedDirectory

A directory of entries that share a common data structure. For example,

ExtendedDirectoryEntry

A single entry of a directory.

ExtendedDirectoryEntryCollection

Provides a view on a directory's entries.

Module Contents

org.models.directory.ExtendedDirectorySearchWidget: TypeAlias = DirectorySearchWidget['ExtendedDirectoryEntry'][source]
class org.models.directory.DirectorySubmissionAction(session: sqlalchemy.orm.Session, directory_id: uuid.UUID, action: str, submission_id: uuid.UUID)[source]
session[source]
directory_id[source]
action[source]
submission_id[source]
property submission: onegov.form.FormSubmission | None[source]
property directory: onegov.directory.Directory | None[source]
property ticket: onegov.ticket.Ticket | None[source]
send_mail_if_enabled(request: onegov.org.request.OrgRequest, subject: str, template: str) None[source]
property valid: bool[source]
property is_entry: bool[source]
property is_change: bool[source]
execute(request: onegov.org.request.OrgRequest) None[source]
adopt(request: onegov.org.request.OrgRequest) None[source]
create_new_entry(request: onegov.org.request.OrgRequest, data: dict[str, Any]) onegov.directory.DirectoryEntry[source]
apply_change_request(request: onegov.org.request.OrgRequest, data: dict[str, Any]) onegov.directory.DirectoryEntry[source]
reject(request: onegov.org.request.OrgRequest) None[source]
withdraw_rejection(request: onegov.org.request.OrgRequest) None[source]
class org.models.directory.ExtendedDirectory[source]

Bases: onegov.directory.Directory, onegov.org.models.extensions.AccessExtension, onegov.form.Extendable, onegov.org.models.extensions.GeneralFileLinkExtension

A directory of entries that share a common data structure. For example, a directory of people, of emergency services or playgrounds.

__mapper_args__[source]
es_type_name = 'extended_directories'[source]

Returns the unique type name of the model.

enable_map: onegov.core.orm.mixins.dict_property[str | None][source]
enable_submissions: onegov.core.orm.mixins.dict_property[bool | None][source]
enable_change_requests: onegov.core.orm.mixins.dict_property[bool | None][source]
enable_publication: onegov.core.orm.mixins.dict_property[bool | None][source]
enable_update_notifications: onegov.core.orm.mixins.dict_property[bool | None][source]
required_publication: onegov.core.orm.mixins.dict_property[bool | None][source]
submitter_meta_fields: onegov.core.orm.mixins.dict_property[list[str] | None][source]
submissions_guideline[source]
change_requests_guideline[source]
text[source]
title_further_information: onegov.core.orm.mixins.dict_property[str | None][source]
position: onegov.core.orm.mixins.dict_property[str][source]
price: onegov.core.orm.mixins.dict_property[Literal['free', 'paid'] | None][source]
price_per_submission: onegov.core.orm.mixins.dict_property[float | None][source]
currency: onegov.core.orm.mixins.dict_property[str | None][source]
minimum_price_total: onegov.core.orm.mixins.dict_property[float | None][source]
payment_method: onegov.core.orm.mixins.dict_property[PaymentMethod | None][source]
search_widget_config: onegov.core.orm.mixins.dict_property[dict[str, Any] | None][source]
marker_icon: onegov.core.orm.mixins.dict_property[str | None][source]
marker_color: onegov.core.orm.mixins.dict_property[str | None][source]
overview_two_columns: onegov.core.orm.mixins.dict_property[bool | None][source]
numbering: onegov.core.orm.mixins.dict_property[str | None][source]
numbers: onegov.core.orm.mixins.dict_property[str | None][source]
layout: onegov.core.orm.mixins.dict_property[str | None][source]
property entry_cls_name: str[source]
property es_public: bool[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.

extend_form_class(form_class: type[onegov.directory.models.directory.DirectoryEntryForm], extensions: collections.abc.Collection[str]) type[ExtendedDirectoryEntryForm][source]
form_class_for_submissions(change_request: bool = False) type[ExtendedDirectoryEntryForm][source]

Generates the form_class used for user submissions and change requests. The resulting form always includes a submitter field and all fields. When doing a change request, removes input required validators from UploadFields.

property extensions: tuple[str, Ellipsis][source]
property actual_price: onegov.pay.Price | None[source]
submission_action(action: Literal['adopt', 'reject', 'withdraw_rejection'], submission_id: uuid.UUID) DirectorySubmissionAction[source]
remove_old_pending_submissions() None[source]
class org.models.directory.ExtendedDirectoryEntry[source]

Bases: onegov.directory.DirectoryEntry, onegov.org.models.extensions.PublicationExtension, onegov.org.models.extensions.CoordinatesExtension, onegov.org.models.extensions.AccessExtension, onegov.org.models.extensions.DeletableContentExtension

A single entry of a directory.

__mapper_args__[source]
es_type_name = 'extended_directory_entries'[source]

Returns the unique type name of the model.

internal_notes: onegov.core.orm.mixins.dict_property[str | None][source]
directory: sqlalchemy.orm.relationship[ExtendedDirectory][source]
property es_public: bool[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.

property display_config: dict[str, Any][source]
property contact: markupsafe.Markup | None[source]
property content_fields: tuple[wtforms.Field, Ellipsis] | None[source]
property hidden_label_fields: set[str][source]
class org.models.directory.ExtendedDirectoryEntryCollection(directory: ExtendedDirectory, type: Literal['extended'] = 'extended', keywords: Mapping[str, list[str]] | None = None, page: int = 0, search_widget: ExtendedDirectorySearchWidget | None = None, published_only: bool = False, past_only: bool = False, upcoming_only: bool = False)[source]

Bases: onegov.directory.DirectoryEntryCollection[ExtendedDirectoryEntry]

Provides a view on a directory’s entries.

The directory itself might be a natural place for lots of these methods to reside, but ultimately we want to avoid mixing the concerns of the directory model and this view-supporting collection.

published_only[source]
past_only[source]
upcoming_only[source]
directory: ExtendedDirectory[source]
query() Query[ExtendedDirectoryEntry][source]