diff --git a/src/common/views.py b/src/common/views.py index da5d3d7..89768e1 100644 --- a/src/common/views.py +++ b/src/common/views.py @@ -170,7 +170,9 @@ class ListMixin(ModelViewBase): # 遍历视图定义的过滤字段集合 for arg, operators in self.filter_fields: # 过滤参数不在字段列表中 - if arg not in all_fields: + # 有可能是内嵌字段等,按双下划线切分查找 + pre_field = arg.split("__")[0] + if pre_field not in all_fields: continue # get传递的参数值为空或不存在,忽略 val = request.args.get(arg, "")