From 471ce05898ec2e1186d69c63106eb5eabea53491 Mon Sep 17 00:00:00 2001 From: jhyns Date: Wed, 17 May 2023 17:16:49 +0900 Subject: [PATCH] Fix Product serializer --- market/serializers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/market/serializers.py b/market/serializers.py index c986148..84d35c9 100644 --- a/market/serializers.py +++ b/market/serializers.py @@ -20,22 +20,22 @@ class BrandSerializer(ModelSerializer): class ProductColorSerializer(ModelSerializer): class Meta: model = ProductColor - fields = "__all__" + fields = ("color",) class ProductStorageSerializer(ModelSerializer): class Meta: model = ProductStorage - fields = "__all__" + fields = ("storage",) class ProductSerializer(ModelSerializer): - colors = ProductColorSerializer(many=True, read_only=True) - storages = ProductStorageSerializer(many=True, read_only=True) + color = ProductColorSerializer(many=True, read_only=True) + storage = ProductStorageSerializer(many=True, read_only=True) class Meta: model = Product - fields = ("id", "name", "brand", "colors", "storages") + fields = ("id", "name", "brand", "color", "storage") class ProductListSerializer(ModelSerializer):