From 447b8b265af5e7ff44eeb109ef618066dd2ed63c Mon Sep 17 00:00:00 2001 From: chenzuoqing Date: Tue, 21 Dec 2021 12:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=BC=98=E5=8C=96=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E5=8F=8C=E4=B8=8B=E5=88=92=E7=BA=BF=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=86=85=E5=B5=8C=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, "")