From fce66da1d9dba46d6fc9ec15e11a6d8486ebd021 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 13 Jan 2026 14:15:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20wpr=20=E6=B7=BB=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6wpr=5Ffrom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpmw/filters.py | 1 + apps/wpmw/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/wpmw/filters.py b/apps/wpmw/filters.py index 36d89328..939e6b88 100644 --- a/apps/wpmw/filters.py +++ b/apps/wpmw/filters.py @@ -18,6 +18,7 @@ class WprFilter(filters.FilterSet): "wm": ["exact", "isnull"], "material__process": ["exact"], "material__name": ["exact", "contains"], + "wpr_from": ["exact", "isnull"], "state": ["exact"], "defects": ["exact"], "number": ["exact"] diff --git a/apps/wpmw/views.py b/apps/wpmw/views.py index dcad152a..0b7eb1be 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -41,7 +41,7 @@ class WprViewSet(CustomListModelMixin, RetrieveModelMixin, ComplexQueryMixin, Cu parent_map = {item["id"]: item for item in parent_data} for item in data: if item["wpr_from"]: - item["parent"] = parent_map[item["wpr_from"]] + item["wpr_from_"] = parent_map[item["wpr_from"]] return data def filter_queryset(self, queryset):