Action Mixin
ActionMixin¶
Arbitrary "actions" can be called by POSTing data to the /api/action/
endpoint. The POST request must include the name of the action to be performed, and a matching ActionPlugin plugin must be loaded by the server. Arbitrary data can also be provided to the action plugin via the POST data:
POST {
action: "MyCustomAction",
data: {
foo: "bar",
}
}
Sample Plugin¶
A sample action plugin is provided in the InvenTree
source code, which can be used as a template for creating custom action plugins:
An EXTREMELY simple action plugin which demonstrates the capability of the ActionMixin class.
Source code in src/backend/InvenTree/plugin/samples/integration/simpleactionplugin.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|