2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-24 09:57:40 +00:00

fix serializer for schema

This commit is contained in:
Matthias Mair
2025-10-13 22:19:46 +02:00
parent 25dd16cf6b
commit 81f26c7073
2 changed files with 8 additions and 3 deletions

View File

@@ -352,8 +352,8 @@ class DependentField(serializers.Field):
return None
class InvenTreeModelSerializer(OptFilter, serializers.ModelSerializer):
"""Inherits the standard Django ModelSerializer class, but also ensures that the underlying model class data are checked on validation."""
class BareInvenTreeModelSerializer(serializers.ModelSerializer):
"""Inherits the standard Django ModelSerializer class, but also ensures that the underlying model class data are checked on validation. Without Filtering support."""
# Switch out URLField mapping
serializer_field_mapping = {
@@ -518,6 +518,10 @@ class InvenTreeModelSerializer(OptFilter, serializers.ModelSerializer):
return data
class InvenTreeModelSerializer(OptFilter, BareInvenTreeModelSerializer):
"""Inherits the standard Django ModelSerializer class, but also ensures that the underlying model class data are checked on validation."""
class InvenTreeTaggitSerializer(TaggitSerializer):
"""Updated from https://github.com/glemmaPaul/django-taggit-serializer."""

View File

@@ -22,6 +22,7 @@ from InvenTree.helpers import get_objectreference
from InvenTree.helpers_model import construct_absolute_url
from InvenTree.mixins import DataImportExportSerializerMixin
from InvenTree.serializers import (
BareInvenTreeModelSerializer,
InvenTreeAttachmentSerializerField,
InvenTreeImageSerializerField,
InvenTreeModelSerializer,
@@ -71,7 +72,7 @@ class SettingsValueField(serializers.Field):
return str(data)
class SettingsSerializer(InvenTreeModelSerializer):
class SettingsSerializer(BareInvenTreeModelSerializer):
"""Base serializer for a settings object."""
key = serializers.CharField(read_only=True)