From 8afbc9a0b595d517154b3b19dc3b421ee89b58ab Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 6 Jan 2025 17:08:48 +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=842?= 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 54def096..7ee0ae8c 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -16,7 +16,12 @@ class WprViewSet(CustomListModelMixin, CustomGenericViewSet): prefetch_related_fields = ["defects"] queryset = Wpr.objects.all() serializer_class = WprSerializer - filterset_fields = ["mb", "wm", "state", "material", "defects"] + filterset_fields = { + "mb": ["exact", "isnull"], + "wm": ["exact", "isnull"], + "state": ["exact"], + "defects": ["exact"] + } ordering = ["-create_time"] ordering_fields = ["number", "create_time", "update_time"] search_fields = ["number", "material__name", "material__model", "material__specification"]