add mixins to API

This commit is contained in:
Matthias 2021-11-17 23:35:56 +01:00
parent a996be3f5c
commit 530227e15f
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 6 additions and 0 deletions

View File

@ -52,6 +52,10 @@ class PluginConfig(models.Model):
name += '(not active)' name += '(not active)'
return name return name
# extra attributes form the registry
def mixins(self):
return self.plugin._mixinreg
# functions # functions
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):

View File

@ -17,6 +17,7 @@ class PluginConfigSerializer(serializers.ModelSerializer):
""" """
meta = serializers.DictField(read_only=True) meta = serializers.DictField(read_only=True)
mixins = serializers.DictField(read_only=True)
class Meta: class Meta:
model = PluginConfig model = PluginConfig
@ -25,4 +26,5 @@ class PluginConfigSerializer(serializers.ModelSerializer):
'name', 'name',
'active', 'active',
'meta', 'meta',
'mixins',
] ]