Opened 9 years ago

Last modified 9 years ago

#25599 closed Bug

__iexact filter matches strings of different length — at Version 2

Reported by: Arvid Halma Owned by: nobody
Component: Database layer (models, ORM) Version: 1.8
Severity: Normal Keywords: iexact, filter, query, model
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

I would expect that the __iexact filter for querying models only results in string matches that possibly differ in case, however, it also matches prefixes...

MyModel.objects.filter(name__iexact='king').all()
[<MyModel: KING>, <MyModel: King of Spain>, <MyModel: King of Holland>]

This looks more like __icontains to me... I expected only [<MyModel: KING>]

Change History (2)

comment:1 by Arvid Halma, 9 years ago

Type: UncategorizedBug

comment:2 by Tim Graham, 9 years ago

Description: modified (diff)

What database are you using?

Note: See TracTickets for help on using tickets.
Back to Top