mirror of
https://github.com/Hopiu/django-select2.git
synced 2026-03-16 21:40:23 +00:00
The iterator for reduce function should not have the first element
select &= reduce(lambda x, y: x | Q(**{y: t}), search_fields[1:], Q(**{search_fields[0]: t}))
This commit is contained in:
parent
1e4056bd62
commit
898b2e84dd
1 changed files with 1 additions and 1 deletions
|
|
@ -391,7 +391,7 @@ class ModelSelect2Mixin:
|
|||
term = term.replace('\t', ' ')
|
||||
term = term.replace('\n', ' ')
|
||||
for t in [t for t in term.split(' ') if not t == '']:
|
||||
select &= reduce(lambda x, y: x | Q(**{y: t}), search_fields,
|
||||
select &= reduce(lambda x, y: x | Q(**{y: t}), search_fields[1:],
|
||||
Q(**{search_fields[0]: t}))
|
||||
if dependent_fields:
|
||||
select &= Q(**dependent_fields)
|
||||
|
|
|
|||
Loading…
Reference in a new issue