--
Ticket URL: <https://code.djangoproject.com/ticket/26001>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => akki
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:1>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/6219
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:2>
Comment (by charettes):
I think we should favor the approach suggested in #26184 instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:3>
* needs_better_patch: 0 => 1
Comment:
I agree, let's revisit this if it doesn't.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:4>
* owner: akki =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:5>
* owner: (none) => Krzysztof Nazarewski
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:6>
* owner: Krzysztof Nazarewski => (none)
* status: assigned => new
Comment:
Related to #26184
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:7>
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
Comment:
As far as I tested, you can now use something like `search_fields =
['votes__exact']` to do the appropriate query, however, if a non-integer
search term is entered, the page crashes with `ValueError invalid literal
for int() with base 10: 'abc'` from `IntegerField.get_prep_value()`.
Probably that exception should be caught in
`ModelAdmin.get_search_results()` and no results returned.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:5>
* owner: nobody => Nick Sandford
* status: new => assigned
Comment:
PR: [https://github.com/django/django/pull/10339]
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:6>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:7>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:8>
Comment (by Niclas Olofsson):
Replying to [comment:5 Tim Graham]:
> As far as I tested, you can now use something like `search_fields =
['votes__exact']` to do the appropriate query, however, if a non-integer
search term is entered, the page crashes with `ValueError invalid literal
for int() with base 10: 'abc'` from `IntegerField.get_prep_value()`.
Probably that exception should be caught in
`ModelAdmin.get_search_results()` and no results returned.
We have to consider that there might be multiple search fields of mixed
types though, i.e. `search_fields = ['votes__exact', 'title',
'text__contains']`, just so the matches for other fields does not get
discarded just because one of the fields threw an error.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:9>
* owner: Nick Sandford => (none)
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:10>
Comment (by Mariusz Felisiak):
#34191 was a duplicate for `DecimalField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:11>
Comment (by mishachernyshov):
Replying to [comment:11 Mariusz Felisiak]:
> #34191 was a duplicate for `DecimalField`.
You can use __iexact instead of __exact for non-string fields, I think, it
even makes sense, because the word `exact` means complete equality even
with type. It works for me.
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:12>
can i work on this?
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:13>
* owner: (none) => Saurabh
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/26001#comment:14>