magpie.ui.home.views ==================== .. py:module:: magpie.ui.home.views Classes ------- .. autoapisummary:: magpie.ui.home.views.BaseViews magpie.ui.home.views.HomeViews Functions --------- .. autoapisummary:: magpie.ui.home.views.get_json Module Contents --------------- .. py:class:: BaseViews(request) Bases: :py:obj:`object` Base methods for Magpie UI pages. .. py:attribute:: MAGPIE_FIXED_GROUP_MEMBERSHIPS :value: [] Special :term:`Group` memberships that cannot be edited. .. py:attribute:: MAGPIE_FIXED_GROUP_EDITS :value: [] Special :term:`Group` details that cannot be edited. .. py:attribute:: MAGPIE_FIXED_USERS :value: [] Special :term:`User` details that cannot be edited. .. py:attribute:: MAGPIE_FIXED_USERS_REFS :value: [] Special :term:`User` that cannot have any relationship edited. This includes both :term:`Group` memberships and :term:`Permission` references. .. py:attribute:: MAGPIE_USER_PWD_LOCKED :value: [] Special :term:`User` that *could* self-edit themselves, but is disabled since conflicting with other policies. .. py:attribute:: MAGPIE_USER_PWD_DISABLED :value: [] Special :term:`User` where password cannot be edited (managed by `Magpie` configuration settings). .. py:attribute:: MAGPIE_ANONYMOUS_GROUP :value: None Reference to :py:data:`magpie.constants.MAGPIE_ANONYMOUS_GROUP` for convenience in UI pages. .. py:method:: add_template_data(data: Optional[Dict[magpie.typedefs.Str, Any]] = None) -> Dict[magpie.typedefs.Str, Any] Adds required template data for the 'heading' mako template applied to every UI page. .. py:method:: render(template: magpie.typedefs.Str, data: Optional[Dict[magpie.typedefs.Str, Any]] = None) -> pyramid.response.Response Render the response with an explicit Mako template reference. Views that are decorated by :func:`pyramid.view.view_config` or registered by :meth:`pyramid.config.Configurator.add_view` with a ``renderer`` parameter do not require to call this function as it is auto-resolved with the submitted :paramref:`data`. .. py:function:: get_json(request_or_response: Union[magpie.typedefs.AnyRequestType, magpie.typedefs.AnyResponseType]) -> magpie.typedefs.JSON Retrieves the 'JSON' body of a response using the property/callable according to the response's implementation. .. py:class:: HomeViews(request) Bases: :py:obj:`magpie.ui.utils.BaseViews` Base methods for Magpie UI pages. .. py:method:: home_view() .. py:method:: error_view() 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.