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

Fixed #16063 -- Adjusted admin changelist searches spanning multi-valued relationships. #15022

Merged
merged 1 commit into from Dec 15, 2021

Conversation

jacobtylerwalls
Copy link
Member

@jacobtylerwalls jacobtylerwalls commented Oct 24, 2021

ticket-16063

mailing list thread

Reduces the likelihood of admin searches issuing queries with excessive joins.

@jacobtylerwalls
Copy link
Member Author

jacobtylerwalls commented Oct 24, 2021

After Adam's response on mailing list that we should be sure to add tips for users upgrading, maybe we could document the new behavior in get_search_results() and add a code snippet for achieving the old way of filtering. And then point to this from release notes.

EDIT: I'm less sanguine on this after trying to write an example code block. Most of get_search_results would have to be copied, I think. Perhaps we should go with creating and deprecating an option.

@felixxm
Copy link
Member

felixxm commented Nov 9, 2021

@jacobtylerwalls Please rebase after 948d6d8.

@jacobtylerwalls jacobtylerwalls changed the title Fixed #16063 -- Matched all terms in admin changelist searches spanning multi-valued relationships. Fixed #16063 -- Adjusted the filtering of admin changelist searches spanning multi-valued relationships. Nov 9, 2021
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@jacobtylerwalls Thanks 👍 Personally, I'm in favor, just wondering how to increase visibility of this change. I'm pretty sure that affected user will not notice it until it's too late 😞 . A separate section in the release notes and extra annotation in ModelAdmin.search_fields docs should be a good start.

docs/releases/4.1.txt Outdated Show resolved Hide resolved
tests/admin_changelist/tests.py Outdated Show resolved Hide resolved
tests/admin_changelist/tests.py Outdated Show resolved Hide resolved
docs/releases/4.1.txt Outdated Show resolved Hide resolved
Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Hey @jacobtylerwalls — thanks for this!

I just had a comment on the docs changes… Let me know your thoughts.
(Once we're happy, I'd apply similar throughout; I think for the 4.1.txt block, the final the old way caused too many joins is OK.)

docs/ref/contrib/admin/index.txt Outdated Show resolved Hide resolved
Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

@jacobtylerwalls I quite like that, thank you. Let's see what @felixxm says.
🥇

@felixxm felixxm self-assigned this Dec 14, 2021
…ti-valued relationships.

This reduces the likelihood of admin searches issuing queries with
excessive joins.
@felixxm
Copy link
Member

felixxm commented Dec 15, 2021

Thanks both 🚀

@felixxm felixxm changed the title Fixed #16063 -- Adjusted the filtering of admin changelist searches spanning multi-valued relationships. Fixed #16063 -- Adjusted admin changelist searches spanning multi-valued relationships. Dec 15, 2021
@felixxm felixxm merged commit 76ccce6 into django:main Dec 15, 2021
@jacobtylerwalls jacobtylerwalls deleted the ticket-16063 branch December 15, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants