EntityActionPlugin
Base class for a brick-contributed entity action provider.
Subclass it, set :attr:entity_action_type, implement :meth:get_actions
and :meth:execute_action, then decorate the subclass with
@entity_action_plugin. The subclass is instantiated once and registered
in the global :class:EntityActionRegistry.
Because a disabled brick's modules are never imported, its plugins are never registered: the conditional appearance of actions comes for free.
entity_action_type: EntityActionTypeRun the action identified by action_name.
action_name is the short, un-namespaced name (the dispatch endpoint
strips the plugin namespace before calling this). May return a
navigation instruction in the result.
ModelstrEntityActionResultDTOReturn the actions to show for the given entity.
entity is a model instance of :attr:entity_action_type. Return an
empty list when no action applies.
IMPORTANT: this is called for every plugin of the entity type on every
GET /entity-action/{entity_type}/{id} request. It MUST be cheap -
only in-memory checks on the already-loaded entity (type, flags, file
extension). Do not load resource content, query the DB, or do I/O.
Modellist