{{{
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>]
--
Ticket URL: <https://code.djangoproject.com/ticket/25599>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25599#comment:1>
Old description:
> 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>]
New description:
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>]
--
Comment (by timgraham):
What database are you using?
--
Ticket URL: <https://code.djangoproject.com/ticket/25599#comment:2>
* status: new => closed
* resolution: => invalid
Old description:
> 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>]
New description:
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>]
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25599#comment:3>