From 77e6744a62fbf80ac5429966470a9d8188e4d9a1 Mon Sep 17 00:00:00 2001 From: Eyeeco <1911362549@qq.com> Date: Tue, 16 Jan 2018 22:30:14 -0800 Subject: [PATCH] =?UTF-8?q?[#17]=20=E9=87=87=E8=B4=AD=E6=A8=A1=E5=9D=97=20?= =?UTF-8?q?(#277)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [#17] 采购模块 修改一个字段、给前端展示相应字段的中文 * flake8 * pretty status --- Procurement/serializers/materialsub.py | 4 +--- Procurement/serializers/status_change.py | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Procurement/serializers/materialsub.py b/Procurement/serializers/materialsub.py index 01ddd44..eeafdca 100644 --- a/Procurement/serializers/materialsub.py +++ b/Procurement/serializers/materialsub.py @@ -53,11 +53,9 @@ def create(self, validated_data): class MaterialSubApplyUpdateSerializer(serializers.ModelSerializer): - class Meta: model = MaterialSubApply - fields = '__all__' - read_only_fields = ('applicant',) + fields = ('figure_code', 'work_order', 'production', 'reason') class MaterialSubApplyListSerializer(MaterialSubApplySerializer): diff --git a/Procurement/serializers/status_change.py b/Procurement/serializers/status_change.py index 70cd8e0..41d2461 100644 --- a/Procurement/serializers/status_change.py +++ b/Procurement/serializers/status_change.py @@ -6,6 +6,10 @@ class StatusChangeSerializer(serializers.ModelSerializer): + pretty_original_status = serializers.CharField( + source='get_original_status_display') + pretty_new_status = serializers.CharField( + source='get_new_status_display') class Meta: model = StatusChange