feat: mlog增加查询条件

This commit is contained in:
caoqianming 2023-11-29 16:23:07 +08:00
parent e07034919d
commit eb665c7943
2 changed files with 11 additions and 5 deletions

View File

@ -51,8 +51,13 @@ class MgroupViewSet(CustomModelViewSet):
queryset = Mgroup.objects.all()
serializer_class = MgroupSerializer
select_related_fields = ['create_by', 'belong_dept', 'process']
filterset_fields = ['belong_dept', 'process',
'cate', 'belong_dept__name', 'name']
filterset_fields = {
"belong_dept": ["exact"],
"process": ["exact"],
"cate": ["exact"],
"belong_dept__name": ["exact", "contains"],
"name": ["exact", "contains"]
}
search_fields = ['number']
ordering = ['sort', 'create_time']

View File

@ -50,9 +50,10 @@ class MlogFilter(filters.FilterSet):
"batch": ["exact"],
"handle_date": ["exact"],
"handle_user": ["exact"],
"mtask__mgroup__belong_dept__name": ["exact"],
"mgroup__belong_dept__name": ["exact", "in"],
"mgroup__name": ["exact", "in"],
"mgroup": ["exact"],
"mtask__mgroup__belong_dept__name": ["exact", "contains", "in"],
"mgroup__belong_dept__name": ["exact", "in", "contains"],
"mgroup__name": ["exact", "in", "contains"],
"submit_time": ["isnull"]
}