magpie.ui.home.views¶
Classes¶
Base methods for Magpie UI pages. |
|
Base methods for Magpie UI pages. |
Functions¶
|
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:
objectBase methods for Magpie UI pages.
- 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_GROUPfor 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 bypyramid.config.Configurator.add_view()with arendererparameter do not require to call this function as it is auto-resolved with the submitteddata.
- 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.BaseViewsBase methods for Magpie UI pages.
- 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.