2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-06-18 05:05:26 +00:00

Update metadata

Closes #282
This commit is contained in:
Matthias Mair
2022-05-25 22:30:33 +02:00
parent 57004689a8
commit a55a68d629
8 changed files with 25 additions and 24 deletions

View File

@ -38,7 +38,7 @@ If you want to make your life easier, try to follow these guidelines; break wher
- do not use internal functions - if a functions name starts with `_` it is internal and might change at any time
- keep you imports clean - the APIs for plugins and mixins are young and evolving. Use
```
from plugin import IntegrationPluginBase, registry
from plugin import InvenTreePlugin, registry
from plugin.mixins import APICallMixin, SettingsMixin, ScheduleMixin, BarcodeMixin
```
- deliver as a package - pip is great for dependency management and pypi can serve as a transparent and reliable delivery infrastructure
@ -52,16 +52,16 @@ This example adds a new action under `/api/action/sample` using the ActionMixin.
``` py
# -*- coding: utf-8 -*-
"""sample implementation for ActionPlugin"""
from plugin import IntegrationPluginBase
from plugin import InvenTreePlugin
from plugin.mixins import ActionMixin
class SampleActionPlugin(ActionMixin, IntegrationPluginBase):
class SampleActionPlugin(ActionMixin, InvenTreePlugin):
"""
Use docstrings for everything... pls
"""
PLUGIN_NAME = "SampleActionPlugin"
NAME = "SampleActionPlugin"
ACTION_NAME = "sample"
# metadata