Plugins
Dependency Injection Micro-Framework using Plugins
A Plugin provides some custom behaviour to specific Concrete classes in the class hierarchy The Base class of the hierarchy generally applies the plugins by adding PluginManager as a mixin Plugins can then be injected into any concrete class in its hierarchy.
- class document_catalogue.plugins.AbstractViewPlugin[source]
Defines the API for a plugin that injects behaviour into a View class
- class document_catalogue.plugins.OrderedViewPlugin(query_param='dc_ordering')[source]
Applies ordering to view’s queryset based on URL query argument found in request.GET
- class document_catalogue.plugins.PluginManager[source]
A simple, generic plugin manager. Provides a clean dependency injection mechanism when used as a Mixin: BaseClass(PluginManager) BaseClass implements behaviours for plugins (defined by whatever interface suited to app) ConcreteSubclass(BaseClass) can then RegisterPlugins to inject additional behaviours
- class document_catalogue.plugins.RegisterPlugins(*plugins)[source]
A Decorator for registering a set of plugins to a PluginManager E.g.: @RegisterPlugins(Plugin1(some, parameters), Plugin2())