Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #39 -- Make default search more like Django admin #43

Merged
merged 1 commit into from Mar 9, 2021

Conversation

codingjoe
Copy link
Owner

Different to before we now match search terms only if all
bits match or the entire statement. The last part differs
from the behavior in Django admin, which does not inlcude
exact machtes of the entire search term inlcude spaces.

Partially revert 07054b2

@codecov
Copy link

codecov bot commented Mar 6, 2021

Codecov Report

Merging #43 (7af1da5) into master (e735be2) will decrease coverage by 0.41%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage   99.57%   99.15%   -0.42%     
==========================================
  Files           7        7              
  Lines         233      238       +5     
==========================================
+ Hits          232      236       +4     
- Misses          1        2       +1     
Impacted Files Coverage Δ
django_select2/forms.py 99.42% <92.85%> (-0.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e735be2...7af1da5. Read the comment docs.

Different to before we now match search terms only if all
bits match or the entire statement. The last part differs
from the behavior in Django admin, which does not inlcude
exact machtes of the entire search term inlcude spaces.

Partially revert 07054b2
Copy link

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually fully reverts the change in 07054b2 , because also __startwith queries are split.

But it will definitely have the same behaviour as the admin.

field_select |= Q(**{field: word})

select |= field_select
use_distinct = False
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO a comment about the source of this block would be helpful, right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang, I didn't see this comment, sorry.

@syphar
Copy link

syphar commented Mar 9, 2021

(the test failure feels like it's not related to this change, but flaky, but I didn't check)

I did a short manual test on our systems

@codingjoe codingjoe merged commit 05556e1 into master Mar 9, 2021
@codingjoe codingjoe deleted the issues/39 branch March 9, 2021 08:24
@codingjoe
Copy link
Owner Author

Hi @syphar, no, it doesn't fully revert it. It still performs full phrase search, which it didn't before. However, it did revert the behavior you described in #39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants