magpie.ui.home.views

Classes

BaseViews

Base methods for Magpie UI pages.

HomeViews

Base methods for Magpie UI pages.

Functions

get_json(→ magpie.typedefs.JSON)

Retrieves the 'JSON' body of a response using the property/callable according to the response's implementation.

Module Contents

class magpie.ui.home.views.BaseViews(request)[source]

Bases: object

Base methods for Magpie UI pages.

MAGPIE_FIXED_GROUP_MEMBERSHIPS = []

Special Group memberships that cannot be edited.

MAGPIE_FIXED_GROUP_EDITS = []

Special Group details that cannot be edited.

MAGPIE_FIXED_USERS = []

Special User details that cannot be edited.

MAGPIE_FIXED_USERS_REFS = []

Special User that cannot have any relationship edited.

This includes both Group memberships and Permission references.

MAGPIE_USER_PWD_LOCKED = []

Special User that could self-edit themselves, but is disabled since conflicting with other policies.

MAGPIE_USER_PWD_DISABLED = []

Special User where password cannot be edited (managed by Magpie configuration settings).

MAGPIE_ANONYMOUS_GROUP = None

Reference to magpie.constants.MAGPIE_ANONYMOUS_GROUP for convenience in UI pages.

add_template_data(data: Dict[magpie.typedefs.Str, Any] | None = None) Dict[magpie.typedefs.Str, Any][source]

Adds required template data for the ‘heading’ mako template applied to every UI page.

render(template: magpie.typedefs.Str, data: Dict[magpie.typedefs.Str, Any] | None = None) pyramid.response.Response[source]

Render the response with an explicit Mako template reference.

Views that are decorated by pyramid.view.view_config() or registered by pyramid.config.Configurator.add_view() with a renderer parameter do not require to call this function as it is auto-resolved with the submitted data.

magpie.ui.home.views.get_json(request_or_response: magpie.typedefs.AnyRequestType | magpie.typedefs.AnyResponseType) magpie.typedefs.JSON[source]

Retrieves the ‘JSON’ body of a response using the property/callable according to the response’s implementation.

class magpie.ui.home.views.HomeViews(request)[source]

Bases: magpie.ui.utils.BaseViews

Base methods for Magpie UI pages.

home_view()[source]
error_view()[source]

Generates the wrapped API error view for cleaner error page returned by the UI.

Renders a controlled UI error page with viewable details of the error generated by an API sub-request or some generic processing operation. The API HTTP error status code is forwarded to this UI response.