-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
QueryArrayWidget does not work with the foo=bar,baz syntax #1685 #1686
base: main
Are you sure you want to change the base?
Conversation
What should I do to get this merged in? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not following the desire here. The QueryArrayWidget is for old PHP-style price[]
query string parameters.
tests/test_widgets.py
Outdated
@@ -526,11 +527,14 @@ def test_widget(self): | |||
<input type="text" name="price" value="1,2" />""", | |||
) | |||
|
|||
import django.http |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this import here?
@@ -595,3 +599,7 @@ def test_widget_value_from_datadict(self): | |||
|
|||
result = w.value_from_datadict({}, {}, "price") | |||
self.assertEqual(result, []) | |||
|
|||
data = QueryDict("price=1,2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a query array example. 🤔
Thanks for the review! Will update the PR. The reason for this PR is that:
This makes it hard for the frontend to know when to use which and also the frontend like to use ?a=x,y also for the ModelMultipleChoiceFilter. With this fixes, you can in both cases use a QueryArrayWidget and all three search filters, for all types of filtering that uses multiple entries (whether __in or ModelMultipleChoiceFilter):
|
This is the failing test.