org.models.directory
Attributes
Classes
A directory of entries that share a common data structure. For example, |
|
A single entry of a directory. |
|
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]
-
- send_mail_if_enabled(request: onegov.org.request.OrgRequest, subject: str, template: str) None [source]
- create_new_entry(request: onegov.org.request.OrgRequest, data: dict[str, Any]) onegov.directory.DirectoryEntry [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.
- 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.
- submission_action(action: Literal['adopt', 'reject', 'withdraw_rejection'], submission_id: uuid.UUID) DirectorySubmissionAction [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.
- 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.
- 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.
- directory: ExtendedDirectory[source]
- query() Query[ExtendedDirectoryEntry] [source]