feat: 增加route和routepack查询条件

This commit is contained in:
caoqianming 2024-07-11 13:28:30 +08:00
parent 4177ba93f8
commit 12fb18205d
2 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,8 @@ class RouteFilter(filters.FilterSet):
"material_out": ["exact", "in"],
"process": ["exact", "in"],
"is_autotask": ["exact"],
"routepack": ["exact"],
"routepack__state": ["exact"],
"mgroup": ["exact", "in", "isnull"],
"mgroup__name": ["exact", "contains"],
"mgroup__belong_dept": ["exact"],

View File

@ -186,7 +186,7 @@ class RoutePackViewSet(CustomModelViewSet):
serializer_class = RoutePackSerializer
search_fields = ['name']
select_related_fields = ['material', 'create_by']
filterset_fields = ['material']
filterset_fields = ['material', 'state']
def update(self, request, *args, **kwargs):
obj: RoutePack = self.get_object()