feat: wprlist增加筛选条件
This commit is contained in:
parent
8afbc9a0b5
commit
3efeb746dc
|
@ -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
|
Loading…
Reference in New Issue