Opal provides a plugin mechanism to help developers write generic reusable components.
Plugins must inherit from
OpalPlugin is a discoverable feature - it will be
automatically discovered by Opal if placed in a
plugin.py file within an
installed Django app.
A Django urlpatterns object to add to our urls. Default is .
A python iterable of APIs to add to the Django Rest Framework APIs available.
class MyPlugin(OpalPlugin): apis = [ ('ping', api.PingViewSet) ]
A python iterable of stylesheets to add to our application. These will be included on every page by default.
class MyPlugin(OpalPlugin): stylesheets = 'css/myawesomestyles.css' ]
A python iterable of items to add to the main menu of our application.
A Python iterable of templates to include as actions - e.g. additional buttons to add to the context of a detail, list or other view. These are visible everywhere by default, so care should be taken to ensire appropriate show/hide logic is present.
Returns the Django url patterns to be registered. Defaults to simply returning the
Returns the APIs to be registered with the Django Rest Framework APIs. Defaults to simply
Returns the path to the directory containing the file in which this plugin is defined.