org.forms.directory

Classes

DirectoryBaseForm

Form for directories.

DirectoryForm

Form for directories.

DirectoryImportForm

DirectoryUrlForm

For changing the URL of a directory independent of the title.

DirectoryRecipientForm

Form for adding recipients of entry updates to the directory.

Module Contents

class org.forms.directory.DirectoryBaseForm[source]

Bases: onegov.form.Form

Form for directories.

request: onegov.org.request.OrgRequest[source]
title[source]
lead[source]
title_further_information[source]
text[source]
position[source]
parsed_structure[source]
enable_map[source]
title_format[source]
lead_format[source]
empty_notice[source]
numbering[source]
numbers[source]
content_fields[source]
content_hide_labels[source]
contact_fields[source]
keyword_fields[source]
thumbnail[source]
show_as_thumbnails[source]
overview_two_columns[source]
address_block_title_type[source]
address_block_title[source]
marker_icon[source]
marker_color_type[source]
marker_color_value[source]
order[source]
order_format[source]
order_direction[source]
enable_submissions[source]
submissions_guideline[source]
invoicing_party[source]
cost_object[source]
price[source]
price_per_submission[source]
currency[source]
enable_change_requests[source]
change_requests_guideline[source]
enable_publication[source]
required_publication[source]
enable_update_notifications[source]
notification_address[source]
enable_notification_pdf_signing[source]
submitter_meta_fields[source]
layout[source]
property known_field_ids: set[str] | None[source]
property known_fields: tuple[onegov.form.parser.core.ParsedField, ...] | None[source]
property missing_fields: dict[str, list[str]] | None[source]
extract_field_ids(field: wtforms.Field) → collections.abc.Iterator[str][source]
validate_title_format(field: wtforms.Field) → None[source]
validate_lead_format(field: wtforms.Field) → None[source]
validate_thumbnail(field: wtforms.Field) → None[source]
validate_numbers(field: wtforms.Field) → None[source]
ensure_public_fields_for_submissions() → bool | None[source]

Force directories to show all fields (no hidden fields) if the user may send in new entries or update exsting ones.

Otherwise we would have to filter out private fields which presents all kinds of edge-cases that we should probably not solve - directories are not meant to be private repositories.

ensure_no_change_requests_with_admin_notifications() → bool | None[source]

Change requests are applied without going through the mutability restrictions that protect already published entries from being silently altered, so they would allow bypassing the guarantees the admin notification is meant to provide (e.g. proof of publication for permits). Therefore the two settings are mutually exclusive.

ensure_notification_address_requires_required_publication() → bool | None[source]

The admin notification workflow is a proof-of-publication tool: it relies on every entry having a publication period. Without required publication an entry could be published immediately with no start (which the hourly cronjob’s start-transition scan never notifies on), so a notification address only makes sense when publication dates are required.

first_hidden_field(configuration: onegov.directory.DirectoryConfiguration) → onegov.form.parser.core.ParsedField | None[source]

Returns the first hidden field, or None.

is_public(fid: str, configuration: onegov.directory.DirectoryConfiguration) → bool[source]

Returns true if the given field id is public.

A field is public, if none of these are true:

  • It is part of the title/lead

  • It is part of the display

  • It is part of the keywords

  • It is used as the thumbnail

Though we might also glean other fields if they are simply searchable or if they are part of the link pattern, we do not count those as public, because we are interested in obviously public fields clearly visible to the user.

property default_marker_color: str[source]
property marker_color: str | None[source]
property configuration: onegov.directory.DirectoryConfiguration[source]
populate_obj(obj: onegov.org.models.ExtendedDirectory) → None[source]
process_obj(obj: onegov.org.models.ExtendedDirectory) → None[source]
class org.forms.directory.DirectoryForm[source]

Bases: DirectoryBaseForm, onegov.org.forms.generic.PaymentForm

Form for directories.

class org.forms.directory.DirectoryImportForm[source]

Bases: onegov.form.Form

import_config[source]
mode[source]
zip_file[source]
static clear_entries(session: sqlalchemy.orm.Session, target: onegov.org.models.ExtendedDirectory) → None[source]
run_import(target: onegov.org.models.ExtendedDirectory) → int[source]
class org.forms.directory.DirectoryUrlForm[source]

Bases: onegov.org.forms.generic.ChangeAdjacencyListUrlForm

For changing the URL of a directory independent of the title.

validate_name(field: wtforms.fields.StringField) → None[source]
class org.forms.directory.DirectoryRecipientForm[source]

Bases: onegov.form.Form

Form for adding recipients of entry updates to the directory.

address[source]