Views#
- class plinth.views.AppView(*args, **kwargs)[source]#
A generic view for showing an app’s main page.
The view and it’s template may be customized but by default show the following:
Icon for the app
Name of the app
Description of the app
Link to the manual page for the app
A button to enable/disable the app
A toolbar with common actions such as ‘Run diagnostics’
A status section showing the running status of the app
A form for configuring the app
The following class properties are available on the view:
‘app_id’ is the mandatory property to set the ID of the app. It is used to retrieve the App instance for the app that is needed for basic information and operations such as enabling/disabling the app.
‘form_class’ is the Django form class that is used by this view. It may be None if the app does not have a configuration form. Default is None.
‘template_name’ is the template used to render this view. By default it is app.html. It may be overridden with a template that derives from app.html to customize the appearance of the app to achieve more complex presentation instead of the simple appearance provided by default.
- property app#
Return the app for which this view is configured.
- dispatch(request, *args, **kwargs)[source]#
If operations are running on the app, use a different view.
- get_common_status()[source]#
Return the status needed for form and template.
Avoid multiple queries to expensive operations such as app.is_enabled().
- get_enable_disable_form()[source]#
Return an instance of the app enable/disable form.
If the app can’t be disabled by the user, return None.
- get_form(*args, **kwargs)[source]#
Return an instance of this view’s form.
Also the form_class for this view to be None.
- property success_url#
The type of the None singleton.