From 0673580d3ba46d1acd40b9485debda8aa49c9514 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 6 Jan 2025 17:06:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20wprlist=E9=BB=98=E8=AE=A4=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E5=B7=B2=E6=B6=88=E8=80=97=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpmw/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/wpmw/views.py b/apps/wpmw/views.py index ce7afb59..54def096 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -19,4 +19,9 @@ class WprViewSet(CustomListModelMixin, CustomGenericViewSet): filterset_fields = ["mb", "wm", "state", "material", "defects"] ordering = ["-create_time"] ordering_fields = ["number", "create_time", "update_time"] - search_fields = ["number", "material__name", "material__model", "material__specification"] \ No newline at end of file + search_fields = ["number", "material__name", "material__model", "material__specification"] + + def filter_queryset(self, queryset): + qs = super().filter_queryset(queryset) + qs.exclude(mb=None, wm=None) + return qs \ No newline at end of file