feat: wpr 添加筛选条件wpr_from
This commit is contained in:
parent
feb8bd6770
commit
fce66da1d9
|
|
@ -18,6 +18,7 @@ class WprFilter(filters.FilterSet):
|
||||||
"wm": ["exact", "isnull"],
|
"wm": ["exact", "isnull"],
|
||||||
"material__process": ["exact"],
|
"material__process": ["exact"],
|
||||||
"material__name": ["exact", "contains"],
|
"material__name": ["exact", "contains"],
|
||||||
|
"wpr_from": ["exact", "isnull"],
|
||||||
"state": ["exact"],
|
"state": ["exact"],
|
||||||
"defects": ["exact"],
|
"defects": ["exact"],
|
||||||
"number": ["exact"]
|
"number": ["exact"]
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class WprViewSet(CustomListModelMixin, RetrieveModelMixin, ComplexQueryMixin, Cu
|
||||||
parent_map = {item["id"]: item for item in parent_data}
|
parent_map = {item["id"]: item for item in parent_data}
|
||||||
for item in data:
|
for item in data:
|
||||||
if item["wpr_from"]:
|
if item["wpr_from"]:
|
||||||
item["parent"] = parent_map[item["wpr_from"]]
|
item["wpr_from_"] = parent_map[item["wpr_from"]]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def filter_queryset(self, queryset):
|
def filter_queryset(self, queryset):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue