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:
@ -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
|
||||
|
Reference in New Issue
Block a user