SearchFilter incorrectly split value with istartswith filter #9271
Unanswered
Arti3DPlayer
asked this question in
Potential Issue
Replies: 2 comments 1 reply
-
So... I don't think it's necessarily(?) that obvious which behaviour I'd expect, and might depend on the UI. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Yeah. I'd probs override 'filter_queryset' and move on with your day. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When we define filter field with
istartswith
as described in docssearch_fields=["^address", ]
and will try to search by string that contains spaces:
123 Main St
, it will not work, because split term in this case is working incorrectly and split string as:Q(address_istartwith="123) | Q(address_istartwith="Main") | Q(address_istartwith="St")
(source)Expected behaviour to generate query like:
Q(address_istartwith="123 Main St")
Version:
djangorestframework==3.14.0
Beta Was this translation helpful? Give feedback.
All reactions