From f7e27c290f5762c5ca3dd035b14b76b3fd00688c Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 17 Sep 2025 11:14:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20wpr=20list=20=E8=BF=94=E5=9B=9Eprocess?= =?UTF-8?q?=5Fname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpmw/serializers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/wpmw/serializers.py b/apps/wpmw/serializers.py index 860dbbba..8191af4d 100644 --- a/apps/wpmw/serializers.py +++ b/apps/wpmw/serializers.py @@ -24,6 +24,13 @@ class WprSerializer(CustomModelSerializer): class Meta: model = Wpr fields = '__all__' + + def to_representation(self, instance): + ret = super().to_representation(instance) + material_name = ret.get("material_name", "") + if material_name: + ret["process_name"] = material_name.split("|")[-1] + return ret class WprDetailSerializer(WprSerializer): mb_ = MaterialBatchSerializer(source='mb', read_only=True)