From 530227e15f5bfcb485fdac64cffd7bb8c94a4c3a Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 17 Nov 2021 23:35:56 +0100 Subject: [PATCH] add mixins to API --- InvenTree/plugin/models.py | 4 ++++ InvenTree/plugin/serializers.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/InvenTree/plugin/models.py b/InvenTree/plugin/models.py index 2c9f00d5f8..07c9641cfa 100644 --- a/InvenTree/plugin/models.py +++ b/InvenTree/plugin/models.py @@ -52,6 +52,10 @@ class PluginConfig(models.Model): name += '(not active)' return name + # extra attributes form the registry + def mixins(self): + return self.plugin._mixinreg + # functions def __init__(self, *args, **kwargs): diff --git a/InvenTree/plugin/serializers.py b/InvenTree/plugin/serializers.py index b5a2780529..b55828001c 100644 --- a/InvenTree/plugin/serializers.py +++ b/InvenTree/plugin/serializers.py @@ -17,6 +17,7 @@ class PluginConfigSerializer(serializers.ModelSerializer): """ meta = serializers.DictField(read_only=True) + mixins = serializers.DictField(read_only=True) class Meta: model = PluginConfig @@ -25,4 +26,5 @@ class PluginConfigSerializer(serializers.ModelSerializer): 'name', 'active', 'meta', + 'mixins', ]