diff --git a/apps/wpmw/filters.py b/apps/wpmw/filters.py index 36d89328..939e6b88 100644 --- a/apps/wpmw/filters.py +++ b/apps/wpmw/filters.py @@ -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"] diff --git a/apps/wpmw/views.py b/apps/wpmw/views.py index dcad152a..0b7eb1be 100644 --- a/apps/wpmw/views.py +++ b/apps/wpmw/views.py @@ -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):