org.request

Classes

PageMeta

OrgRequest

Extends the default Morepath request with virtual host support and

Module Contents

class org.request.PageMeta[source]

Bases: NamedTuple

id: int[source]
type: str[source]
title: str[source]
access: str[source]
published: bool[source]
is_visible_on_homepage: bool | None[source]
path: str[source]
children: tuple[PageMeta, Ellipsis][source]
class org.request.OrgRequest(*args, **kwargs)[source]

Bases: onegov.core.request.CoreRequest

Extends the default Morepath request with virtual host support and other useful methods.

Virtual hosting might be supported by Morepath directly in the future: https://github.com/morepath/morepath/issues/185

app: onegov.org.app.OrgApp[source]

morepath.App instance currently handling request.

property is_manager: bool[source]

Returns true if the current user is logged in, and has the role editor or admin.

is_manager_for_model(model: object) bool[source]
property is_admin: bool[source]

Returns true if the current user is an admin.

property is_editor: bool[source]

Returns true if the current user is an editor.

property current_username: str | None[source]
property current_user: onegov.user.User | None[source]
property first_admin_available: onegov.user.User | None[source]
property auto_accept_user: onegov.user.User | None[source]
property email_for_new_tickets: str | None[source]
property active_mtan_session: bool[source]
property mtan_accesses: onegov.org.models.TANAccessCollection[source]
property mtan_access_limit_exceeded: bool[source]
auto_accept(ticket: onegov.ticket.Ticket) bool[source]
pages_tree() tuple[PageMeta, Ellipsis][source]

This is the entire pages tree preloaded into the individual parent/children attributes. We optimize this as much as possible by performing the recursive join in Python, rather than SQL.

root_pages() tuple[PageMeta, Ellipsis][source]
homepage_pages() dict[int, list[PageMeta]][source]