mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add method to access plugin setting faster
This commit is contained in:
parent
9469c17be1
commit
eaffd5fd0c
@ -85,6 +85,13 @@ class SettingsMixin:
|
||||
return {f'PLUGIN_{self.plugin_name().upper()}_{key}': value for key, value in self.settings.items()}
|
||||
return None
|
||||
|
||||
def get_setting(self, key):
|
||||
"""
|
||||
get plugin setting by key
|
||||
"""
|
||||
from common.models import InvenTreeSetting
|
||||
return InvenTreeSetting.get_setting(f'PLUGIN_{self.PLUGIN_NAME.upper()}_{key}')
|
||||
|
||||
|
||||
class UrlsMixin:
|
||||
"""Mixin that enables urls for the plugin"""
|
||||
|
Loading…
Reference in New Issue
Block a user