AKModel.metaviews.status module
- class AKModel.metaviews.status.StatusWidget[source]
Bases:
ABCAbstract parent for status page widgets
- get_context_data(context) dict[source]
Allow to manipulate the context :return: context (with or without changes)
- render(context: {}, request) dict[source]
Render widget based on context
- Parameters:
context – Context for rendering
request – HTTP request, needed for rendering
- Returns:
Dictionary containing the rendered/prepared information
- render_title(context: {}) str[source]
Render title for widget based on context
By default, the title attribute is used without modification :param context: Context for rendering :return: Rendered title
- render_status(context: {}) str[source]
Render status for widget based on context
By default, the status attribute is used without modification :param context: Context for rendering :return: Rendered title
- class AKModel.metaviews.status.TemplateStatusWidget[source]
Bases:
StatusWidgetA
StatusWidgetthat produces its content by rendering a given html template- abstract property template_name: str
Configure the template to use :return: name of the template to use
- render_body(context: {}, request) str[source]
Render the body of the widget using the template rendering method from django (load and render template using the provided context)
- Parameters:
context – context to use for rendering
request – HTTP request (needed by django)
- Returns:
rendered content (HTML)
- class AKModel.metaviews.status.StatusManager[source]
Bases:
objectRegistry for all status widgets
Allows to register status widgets using the @status_manager.register(name=”xyz”) decorator
- class AKModel.metaviews.status.StatusView(**kwargs)[source]
Bases:
ABC,AdminViewMixin,TemplateViewAbstract view: A generic base view to create a status page holding multiple widgets