2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

More refactoring:

- Rename "mixins_globalsettings" to "mixing_settings"
- Fix translation on settings page template
This commit is contained in:
Oliver
2022-01-02 11:21:06 +11:00
parent 737467a1fd
commit f3bfe6e7ca
11 changed files with 91 additions and 53 deletions

View File

@ -2,6 +2,9 @@
"""Base Class for InvenTree plugins"""
from django.utils.text import slugify
class InvenTreePlugin():
"""
Base class for a plugin
@ -10,9 +13,28 @@ class InvenTreePlugin():
# Override the plugin name for each concrete plugin instance
PLUGIN_NAME = ''
PLUGIN_SLUG = ''
PLUGIN_TITLE = ''
def plugin_name(self):
"""get plugin name"""
"""
Return the name of this plugin plugin
"""
return self.PLUGIN_NAME
def plugin_slug(self):
slug = getattr(self, 'PLUGIN_SLUG', None)
if slug is None:
slug = self.plugin_name()
return slugify(slug)
def plugin_title(self):
return self.PLUGIN_TITLE
def __init__(self):
pass