feat: mlog增加查询条件
This commit is contained in:
parent
e07034919d
commit
eb665c7943
|
|
@ -51,8 +51,13 @@ class MgroupViewSet(CustomModelViewSet):
|
||||||
queryset = Mgroup.objects.all()
|
queryset = Mgroup.objects.all()
|
||||||
serializer_class = MgroupSerializer
|
serializer_class = MgroupSerializer
|
||||||
select_related_fields = ['create_by', 'belong_dept', 'process']
|
select_related_fields = ['create_by', 'belong_dept', 'process']
|
||||||
filterset_fields = ['belong_dept', 'process',
|
filterset_fields = {
|
||||||
'cate', 'belong_dept__name', 'name']
|
"belong_dept": ["exact"],
|
||||||
|
"process": ["exact"],
|
||||||
|
"cate": ["exact"],
|
||||||
|
"belong_dept__name": ["exact", "contains"],
|
||||||
|
"name": ["exact", "contains"]
|
||||||
|
}
|
||||||
search_fields = ['number']
|
search_fields = ['number']
|
||||||
ordering = ['sort', 'create_time']
|
ordering = ['sort', 'create_time']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,10 @@ class MlogFilter(filters.FilterSet):
|
||||||
"batch": ["exact"],
|
"batch": ["exact"],
|
||||||
"handle_date": ["exact"],
|
"handle_date": ["exact"],
|
||||||
"handle_user": ["exact"],
|
"handle_user": ["exact"],
|
||||||
"mtask__mgroup__belong_dept__name": ["exact"],
|
"mgroup": ["exact"],
|
||||||
"mgroup__belong_dept__name": ["exact", "in"],
|
"mtask__mgroup__belong_dept__name": ["exact", "contains", "in"],
|
||||||
"mgroup__name": ["exact", "in"],
|
"mgroup__belong_dept__name": ["exact", "in", "contains"],
|
||||||
|
"mgroup__name": ["exact", "in", "contains"],
|
||||||
"submit_time": ["isnull"]
|
"submit_time": ["isnull"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue