From 3efeb746dc239ef159ef78413497264e70a397d8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 7 Jan 2025 08:38:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20wprlist=E5=A2=9E=E5=8A=A0=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpmw/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/wpmw/views.py b/apps/wpmw/views.py index 7ee0ae8c..0d8b6d01 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -19,6 +19,7 @@ class WprViewSet(CustomListModelMixin, CustomGenericViewSet): filterset_fields = { "mb": ["exact", "isnull"], "wm": ["exact", "isnull"], + "material__process": ["exact"], "state": ["exact"], "defects": ["exact"] } @@ -28,5 +29,8 @@ class WprViewSet(CustomListModelMixin, CustomGenericViewSet): def filter_queryset(self, queryset): qs = super().filter_queryset(queryset) - qs.exclude(mb=None, wm=None) + if "mb__isnull" in self.request.query_params or "wm__isnull" in self.request.query_params: + pass + else: + qs.exclude(mb=None, wm=None) return qs \ No newline at end of file