Opened 14 years ago
Last modified 13 years ago
#15203 closed
admin search_fields splitting query — at Version 2
Reported by: | Waldemar Kornewald | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When you specify a ModelAdmin search_field as exact (with "=" prefix) the user's search query is split() and then multiple __iexact
filters are applied, one for each word. This behavior doesn't make sense with a CharField because we're doing an iexact match (there's no way two distinct filters can match at the same time, except if we're doing a JOIN). It should just take the whole query and match against that.
The same problem probably also affects __search
queries (with an "@" prefix). The string should probably also be passed directly to the DB.
Change History (2)
comment:1 by , 14 years ago
Cc: | added |
---|
comment:2 by , 14 years ago
Description: | modified (diff) |
---|
(WikiFormatted slightly description)