winterthur.app

Classes

WinterthurApp

Baseclass for Morepath OneGov applications.

Functions

enable_iframes_tween_factory(...)

get_template_directory(→ str)

get_static_directory(→ str)

get_theme(→ onegov.winterthur.theme.WinterthurTheme)

get_create_new_organisation_factory(...)

get_default_directory_search_widget(→ str)

get_default_event_search_widget(→ str)

get_i18n_localedirs(→ list[str])

get_js_path(→ str)

get_webasset_output(→ str)

get_search_asset(→ Iterator[str])

get_iframe_resizer(→ Iterator[str])

get_iframe_enhancements(→ Iterator[str])

get_common_asset(→ Iterator[str])

Module Contents

class winterthur.app.WinterthurApp[source]

Bases: onegov.org.OrgApp

Baseclass for Morepath OneGov applications.

serve_static_files = True[source]

Returns True if /static files should be served. Needs to be enabled manually.

Note that even if the static files are not served, /static path is still served, it just won’t return anything but a 404.

Note also that static files are served publicly. You can override this in your application, but doing that and testing for it is on you!

See also: onegov.core.static.

frame_ancestors[source]
configure_organisation(*, enable_user_registration: bool = False, enable_yubikey: bool = False, disable_password_reset: bool = False, **cfg: Any) None[source]
enable_iframes(request: onegov.winterthur.request.WinterthurRequest) None[source]
property roadwork_cache: onegov.core.cache.RedisCacheRegion[source]
property roadwork_client: onegov.winterthur.roadwork.RoadworkClient[source]
property mission_report_legend: markupsafe.Markup[source]
property hide_civil_defence_field: bool[source]
static_file(path: str) onegov.core.static.StaticFile[source]
get_shift_schedule_image() io.BytesIO | None[source]

Gets or creates an image of the latest public pdf.

We store the image using the last modified timestamp - this way, we have a version of past images. Note that we don’t delete any old images of shift schedules.

winterthur.app.enable_iframes_tween_factory(app: WinterthurApp, handler: Callable[[WinterthurRequest], Response]) Callable[[WinterthurRequest], Response][source]
winterthur.app.get_template_directory() str[source]
winterthur.app.get_static_directory() str[source]
winterthur.app.get_theme() onegov.winterthur.theme.WinterthurTheme[source]
winterthur.app.get_create_new_organisation_factory() Callable[[WinterthurApp, str], Organisation][source]
winterthur.app.get_default_directory_search_widget() str[source]
winterthur.app.get_default_event_search_widget() str[source]
winterthur.app.get_i18n_localedirs() list[str][source]
winterthur.app.get_js_path() str[source]
winterthur.app.get_webasset_output() str[source]
winterthur.app.get_search_asset() Iterator[str][source]
winterthur.app.get_iframe_resizer() Iterator[str][source]
winterthur.app.get_iframe_enhancements() Iterator[str][source]
winterthur.app.get_common_asset() Iterator[str][source]