From 20dddab5583a60246cd10484d554d5500dc0d279 Mon Sep 17 00:00:00 2001 From: eyeeco <1911362549@qq.com> Date: Fri, 12 Jan 2018 07:41:05 -0800 Subject: [PATCH] =?UTF-8?q?[#17]=20=E4=BF=AE=E6=94=B9=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Procurement/api/supplier.py | 2 +- Procurement/serializers/supplier.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Procurement/api/supplier.py b/Procurement/api/supplier.py index 95a37d5..2d999d7 100644 --- a/Procurement/api/supplier.py +++ b/Procurement/api/supplier.py @@ -19,7 +19,7 @@ def get_serializer_class(self): elif self.action == "retrieve": return serializers.SupplierDetailSerializer else: - return serializers.SupplierSerializer + return serializers.SupplierDetailSerializer # 供应商文件 diff --git a/Procurement/serializers/supplier.py b/Procurement/serializers/supplier.py index c44512e..b39282e 100644 --- a/Procurement/serializers/supplier.py +++ b/Procurement/serializers/supplier.py @@ -28,18 +28,18 @@ class Meta: class SupplierListSerializer(SupplierSerializer): - doc = SupplierDocumentSerializer(read_only=True, many=True) + docs = SupplierDocumentSerializer(read_only=True, many=True) class Meta(SupplierSerializer.Meta): - fields = '__all__' + fields = ('id', 'uid', 'name', 'docs') class SupplierDetailSerializer(SupplierSerializer): - doc = SupplierDocumentSerializer(read_only=True, many=True) - quotation = QuotationSerializer(read_only=True, many=True) + docs = SupplierDocumentSerializer(read_only=True, many=True) + quotations = QuotationSerializer(read_only=True, many=True) class Meta(SupplierSerializer.Meta): - fields = '__all__' + fields = ('id', 'uid', 'name', 'docs', 'quotations') # 供应商关系