election_day.app

Classes

ElectionDayApp

The election day application. Include this in your onegov.yml to serve

Functions

get_static_directory(→ str)

get_template_directory(→ str)

get_theme(→ onegov.election_day.theme.ElectionDayTheme)

get_i18n_localedirs(→ list[str])

get_i18n_used_locales(→ set[str])

get_i18n_default_locale(→ str)

org_content_security_policy(...)

enable_iframes_and_analytics_tween_factory(...)

override_language_tween_factory(...)

cache_control_tween_factory(...)

micro_cache_anonymous_pages_tween_factory(...)

get_shared_assets_path(→ str)

get_js_path(→ str)

get_css_path(→ str)

get_webasset_output(→ str)

get_common_asset(→ Iterator[str])

get_custom_asset(→ Iterator[str])

get_backend_common_asset(→ Iterator[str])

get_screen_asset(→ Iterator[str])

Module Contents

class election_day.app.ElectionDayApp[source]

Bases: onegov.core.Framework, onegov.form.FormApp, onegov.user.UserApp, onegov.file.DepotApp

The election day application. Include this in your onegov.yml to serve it with onegov-server.

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.

request_class[source]

The class of the Request to create. Must be a subclass of morepath.Request.

By default the request class is morepath.Request

csv_file[source]
json_file[source]
manage_form[source]
manage_html[source]
pdf_file[source]
svg_file[source]
screen_widget[source]
property principal: Canton | Municipality[source]

Returns the principal of the election day app. See onegov.election_day.models.principal.Principal.

load_principal() Canton | Municipality | None[source]

The principal is defined in the principal.yml file stored on the applications filestorage root.

If the file does not exist, the site root does not exist and therefore a 404 is returned.

The structure of the yaml file is defined in class:onegov.election_app.model.Principal.

Returns the logo as onegov.core.filestorage.FilestorageFile.

property theme_options: dict[str, Any][source]

Returns the application-bound theme options.

property pages_cache: onegov.core.cache.RedisCacheRegion[source]

A cache for pages.

election_day.app.get_static_directory() str[source]
election_day.app.get_template_directory() str[source]
election_day.app.get_theme() onegov.election_day.theme.ElectionDayTheme[source]
election_day.app.get_i18n_localedirs() list[str][source]
election_day.app.get_i18n_used_locales() set[str][source]
election_day.app.get_i18n_default_locale() str[source]
election_day.app.org_content_security_policy() more.content_security.ContentSecurityPolicy[source]
election_day.app.enable_iframes_and_analytics_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response][source]
election_day.app.override_language_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response][source]
election_day.app.cache_control_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response][source]
election_day.app.micro_cache_anonymous_pages_tween_factory(app: ElectionDayApp, handler: Callable[[ElectionDayRequest], Response]) Callable[[ElectionDayRequest], Response][source]
election_day.app.get_shared_assets_path() str[source]
election_day.app.get_js_path() str[source]
election_day.app.get_css_path() str[source]
election_day.app.get_webasset_output() str[source]
election_day.app.get_common_asset() Iterator[str][source]
election_day.app.get_custom_asset() Iterator[str][source]
election_day.app.get_backend_common_asset() Iterator[str][source]
election_day.app.get_screen_asset() Iterator[str][source]