fix(用户管理): 🐛 用户管理查询

This commit is contained in:
猿小天
2023-03-20 10:14:54 +08:00
parent 9be65db65c
commit 75f6153a9d
2 changed files with 2 additions and 11 deletions

View File

@@ -228,16 +228,7 @@ class UserViewSet(CustomModelViewSet):
serializer_class = UserSerializer
create_serializer_class = UserCreateSerializer
update_serializer_class = UserUpdateSerializer
# filter_fields = ["name", "username", "gender", "is_active", "dept", "user_type"]
filter_fields = {
"name": ["exact"],
"mobile": ["exact"],
"username": ["exact"],
"gender": ["icontains"],
"is_active": ["icontains"],
"dept": ["exact"],
"user_type": ["exact"],
}
filter_fields = ["name", "username", "gender", "is_active", "dept", "user_type"]
search_fields = ["username", "name", "gender", "dept__name", "role__name"]
# 导出
export_field_label = {