org.models.directory ==================== .. py:module:: org.models.directory Attributes ---------- .. autoapisummary:: org.models.directory.ExtendedDirectorySearchWidget Classes ------- .. autoapisummary:: org.models.directory.DirectorySubmissionAction org.models.directory.ExtendedDirectory org.models.directory.ExtendedDirectoryEntry org.models.directory.ExtendedDirectoryEntryCollection Module Contents --------------- .. py:type:: ExtendedDirectorySearchWidget :canonical: DirectorySearchWidget['ExtendedDirectoryEntry'] .. py:class:: DirectorySubmissionAction(session: sqlalchemy.orm.Session, directory_id: uuid.UUID, action: str, submission_id: uuid.UUID) .. py:attribute:: session .. py:attribute:: directory_id .. py:attribute:: action .. py:attribute:: submission_id .. py:property:: submission :type: onegov.form.FormSubmission | None .. py:property:: directory :type: onegov.directory.Directory | None .. py:property:: ticket :type: onegov.ticket.Ticket | None .. py:method:: send_mail_if_enabled(request: onegov.org.request.OrgRequest, subject: str, template: str) -> None .. py:property:: valid :type: bool .. py:property:: is_entry :type: bool .. py:property:: is_change :type: bool .. py:method:: execute(request: onegov.org.request.OrgRequest) -> None .. py:method:: adopt(request: onegov.org.request.OrgRequest) -> None .. py:method:: create_new_entry(request: onegov.org.request.OrgRequest, data: dict[str, Any]) -> onegov.directory.DirectoryEntry .. py:method:: apply_change_request(request: onegov.org.request.OrgRequest, data: dict[str, Any]) -> onegov.directory.DirectoryEntry .. py:method:: reject(request: onegov.org.request.OrgRequest) -> None .. py:method:: withdraw_rejection(request: onegov.org.request.OrgRequest) -> None .. py:class:: ExtendedDirectory Bases: :py:obj:`onegov.directory.Directory`, :py:obj:`onegov.org.models.extensions.AccessExtension`, :py:obj:`onegov.form.Extendable`, :py:obj:`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. .. py:attribute:: __mapper_args__ .. py:attribute:: es_type_name :value: 'extended_directories' Returns the unique type name of the model. .. py:attribute:: content_fields_containing_links_to_files .. py:attribute:: enable_map :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: enable_submissions :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: enable_change_requests :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: enable_publication :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: enable_update_notifications :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: required_publication :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: submitter_meta_fields :type: onegov.core.orm.mixins.dict_property[list[str] | None] .. py:attribute:: submissions_guideline .. py:attribute:: change_requests_guideline .. py:attribute:: text .. py:attribute:: title_further_information :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: position :type: onegov.core.orm.mixins.dict_property[str] .. py:attribute:: price :type: onegov.core.orm.mixins.dict_property[Literal['free', 'paid'] | None] .. py:attribute:: price_per_submission :type: onegov.core.orm.mixins.dict_property[float | None] .. py:attribute:: currency :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: minimum_price_total :type: onegov.core.orm.mixins.dict_property[float | None] .. py:attribute:: payment_method :type: onegov.core.orm.mixins.dict_property[onegov.pay.types.PaymentMethod | None] .. py:attribute:: search_widget_config :type: onegov.core.orm.mixins.dict_property[dict[str, Any] | None] .. py:attribute:: marker_icon :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: marker_color :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: overview_two_columns :type: onegov.core.orm.mixins.dict_property[bool | None] .. py:attribute:: numbering :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: numbers :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: layout :type: onegov.core.orm.mixins.dict_property[str | None] .. py:property:: entry_cls_name :type: str .. py:property:: es_public :type: bool 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:method:: extend_form_class(form_class: type[onegov.directory.models.directory.DirectoryEntryForm], extensions: collections.abc.Collection[str]) -> type[ExtendedDirectoryEntryForm] .. py:method:: form_class_for_submissions(change_request: bool = False) -> type[ExtendedDirectoryEntryForm] 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. .. py:property:: extensions :type: tuple[str, Ellipsis] .. py:property:: actual_price :type: onegov.pay.Price | None .. py:method:: submission_action(action: Literal['adopt', 'reject', 'withdraw_rejection'], submission_id: uuid.UUID) -> DirectorySubmissionAction .. py:method:: remove_old_pending_submissions() -> None .. py:class:: ExtendedDirectoryEntry Bases: :py:obj:`onegov.directory.DirectoryEntry`, :py:obj:`onegov.org.models.extensions.PublicationExtension`, :py:obj:`onegov.org.models.extensions.CoordinatesExtension`, :py:obj:`onegov.org.models.extensions.AccessExtension`, :py:obj:`onegov.org.models.extensions.DeletableContentExtension` A single entry of a directory. .. py:attribute:: __mapper_args__ .. py:attribute:: es_type_name :value: 'extended_directory_entries' Returns the unique type name of the model. .. py:attribute:: internal_notes :type: onegov.core.orm.mixins.dict_property[str | None] .. py:attribute:: directory :type: sqlalchemy.orm.relationship[ExtendedDirectory] .. py:property:: es_public :type: bool 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:property:: display_config :type: dict[str, Any] .. py:property:: contact :type: markupsafe.Markup | None .. py:property:: content_fields :type: tuple[wtforms.Field, Ellipsis] | None .. py:property:: hidden_label_fields :type: set[str] .. py:class:: ExtendedDirectoryEntryCollection(directory: ExtendedDirectory, type: Literal['extended'] = 'extended', keywords: collections.abc.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) Bases: :py:obj:`onegov.directory.DirectoryEntryCollection`\ [\ :py:obj:`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. .. py:attribute:: published_only :value: False .. py:attribute:: past_only :value: False .. py:attribute:: upcoming_only :value: False .. py:attribute:: directory :type: ExtendedDirectory .. py:method:: query() -> sqlalchemy.orm.Query[ExtendedDirectoryEntry]