fix: #I53M5B 修复find_filter_lookups条件搜索错误 bug
parent
4e357fc20e
commit
0118b8dca2
|
@ -7,8 +7,8 @@
|
||||||
@Remark: 自定义过滤器
|
@Remark: 自定义过滤器
|
||||||
"""
|
"""
|
||||||
import operator
|
import operator
|
||||||
from collections import OrderedDict
|
|
||||||
import re
|
import re
|
||||||
|
from collections import OrderedDict
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
@ -161,7 +161,9 @@ class CustomDjangoFilterBackend(DjangoFilterBackend):
|
||||||
|
|
||||||
def find_filter_lookups(self, orm_lookups, search_term_key):
|
def find_filter_lookups(self, orm_lookups, search_term_key):
|
||||||
for lookup in orm_lookups:
|
for lookup in orm_lookups:
|
||||||
if lookup.find(search_term_key) >= 0:
|
# if lookup.find(search_term_key) >= 0:
|
||||||
|
# 修复条件搜索错误 bug
|
||||||
|
if lookup == search_term_key:
|
||||||
return lookup
|
return lookup
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue