mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
- Enhanced content for "hello world" panel - Add an optional panel which breaks rendering
24 lines
562 B
Python
24 lines
562 B
Python
"""
|
|
Sample plugin which responds to events
|
|
"""
|
|
|
|
from plugin import InvenTreePlugin
|
|
from plugin.mixins import EventMixin
|
|
|
|
|
|
class EventPluginSample(EventMixin, InvenTreePlugin):
|
|
"""
|
|
A sample plugin which provides supports for triggered events
|
|
"""
|
|
|
|
NAME = "EventPlugin"
|
|
SLUG = "sampleevent"
|
|
TITLE = "Triggered Events"
|
|
|
|
def process_event(self, event, *args, **kwargs):
|
|
""" Custom event processing """
|
|
|
|
print(f"Processing triggered event: '{event}'")
|
|
print("args:", str(args))
|
|
print("kwargs:", str(kwargs))
|