#36508: Asymmetry between exact and iexact when filtering JSON keys against None
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: null, jsonfield | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Jacob Walls:
Old description:
> `exact` and `iexact` vary in their treatment of `None` when looking up
> JSON key paths:
> {{{
> optional_param = request.GET.get("param")
> qs1 = Model.objects.filter(json__key=optional_param)
> qs2 = Model.objects.filter(json__key__iexact=optional_param)
> }}}
>
> [https://dryorm.xterm.info/json-key-filter-none/run fiddle] showing
> `exact` queries return rows where the json key is null, but `iexact`
> queries do not (instead, they check for key existence, e.g.
> `__key__isnull`)
>
> Previous ticket regarding symmetry between `exact` and `iexact`: #21552
> Previous ticket regarding `iexact` on JSON key lookups: #27693
New description:
`exact` and `iexact` vary in their treatment of `None` when looking up
JSON key paths:
{{{
optional_param = request.GET.get("param", None)
qs1 = Model.objects.filter(json__key=optional_param)
qs2 = Model.objects.filter(json__key__iexact=optional_param)
}}}
[https://dryorm.xterm.info/json-key-filter-none/run fiddle] showing
`exact` queries return rows where the json key is null, but `iexact`
queries do not (instead, they check for key existence, e.g.
`__key__isnull`)
Previous ticket regarding symmetry between `exact` and `iexact`: #21552
Previous ticket regarding `iexact` on JSON key lookups: #27693
--
--
Ticket URL: <https://code.djangoproject.com/ticket/36508#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701980ea6b010-db0018be-da6c-4d3c-afdd-fc02f0067d03-000000%40eu-central-1.amazonses.com.