Replace URL text filter with dropdown selection in redirects#13010
Open
ericholscher wants to merge 4 commits into
Open
Replace URL text filter with dropdown selection in redirects#13010ericholscher wants to merge 4 commits into
ericholscher wants to merge 4 commits into
Conversation
Mirror the version filter pattern in RedirectListFilterSet so the URL filter is a searchable model choice dropdown instead of a free-text icontains field. Generated by AI.
Generated by AI.
Member
Author
|
This still solves the problem, so seems better than the current state? |
Addresses review feedback: the filter is labeled "URL" so the URL parameter should also be a URL, not a primary key. Generated by AI.
Contributor
|
Yeah I agree with @stsewd, we should keep the patterns on filters consistent. The code looks close now though, but it would be good to add visual proof of this change here. This branch throws an exception for me locally because my migrations are ahead of this branch. |
agjohnson
approved these changes
Jun 2, 2026
Contributor
agjohnson
left a comment
There was a problem hiding this comment.
Tentative +1, still need to see what this looks like.
But the code looks about what I'd expect and more closely matches the patterns we've used on all other filters now.
…ts-url-filter-ThC5x
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Changed the redirect URL filter from a text-based search field to a dropdown selection using
FilteredModelChoiceFilter. This provides a more structured way to filter redirects by selecting specific redirect objects rather than searching by URL substring.Implementation Details
label_attribute="from_url"to display thefrom_urlfield in the dropdownto_field_name="pk"ensures filtering is done by the redirect's primary keyhttps://claude.ai/code/session_01E11C1jDS4cAwiCY6t6oN2k