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