#31936: JSONField not filtering correct with `__in`
-------------------------------------+-------------------------------------
Reporter: Sébastien | Owner: nobody
Pattyn |
Type: Bug | Status: new
Component: Database | Version: 3.1
layer (models, ORM) |
Severity: Normal | Keywords: JSONField
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I am currently rewriting our app where we will start using
`models.JSONField` instead of `django_mysql.models.JSONField`. I noticed
that the `__in` operator is not reacting the same way is it does on other
fields.
{{{
first_filter = {‘our_field__key__in': [0]}
first_items = OurModel.objects.filter(**first_filter)
len(first_items)
0
second_filter = {'our_field__key': 0}
second_items = OurModel.objects.filter(**second_filter)
len(second_items )
312
}}}
I would expect that both filters would give me the same queryset but this
is not the case.
--
Ticket URL: <https://code.djangoproject.com/ticket/31936>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/060.2e6c9bedff45a44766a95f3714d9e38a%40djangoproject.com.