mirror of
https://github.com/inventree/inventree-docs.git
synced 2025-04-28 05:36:46 +00:00
add footnotes
This commit is contained in:
parent
11ac217f7d
commit
85d3c6e8a9
@ -50,15 +50,15 @@ from plugin.mixins import APICallMixin, SettingsMixin, ScheduleMixin, BarcodeMix
|
|||||||
### A simple example
|
### A simple example
|
||||||
This example adds a new action under `/api/action/sample` using the ActionMixin.
|
This example adds a new action under `/api/action/sample` using the ActionMixin.
|
||||||
``` python
|
``` python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*- # (1)
|
||||||
"""sample implementation for ActionPlugin"""
|
"""sample implementation for ActionPlugin""" # (2)
|
||||||
from plugin import IntegrationPluginBase
|
from plugin import IntegrationPluginBase
|
||||||
from plugin.mixins import ActionMixin
|
from plugin.mixins import ActionMixin
|
||||||
|
|
||||||
|
|
||||||
class SampleActionPlugin(ActionMixin, IntegrationPluginBase):
|
class SampleActionPlugin(ActionMixin, IntegrationPluginBase):
|
||||||
"""
|
"""
|
||||||
Use docstrings for everything... pls
|
Use docstrings for everything... pls # (2)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PLUGIN_NAME = "SampleActionPlugin"
|
PLUGIN_NAME = "SampleActionPlugin"
|
||||||
@ -85,3 +85,7 @@ class SampleActionPlugin(ActionMixin, IntegrationPluginBase):
|
|||||||
def get_result(self):
|
def get_result(self):
|
||||||
return True # This is returned to the client
|
return True # This is returned to the client
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
1. It is recommended to put each plugin into it's own file, this is not required
|
||||||
|
2. Please document you functions and classes - following PEP8 or black is recommended
|
||||||
|
Loading…
x
Reference in New Issue
Block a user