* status: new => closed
* resolution: => worksforme
Comment:
It works as expected for me:
{{{
>>> NullableJSONModel.objects.create(value={'key': None})
NullableJSONModel object (14)
>>> NullableJSONModel.objects.filter(value__key=None)
<QuerySet [<NullableJSONModel: NullableJSONModel object (14)>]>
>>> NullableJSONModel.objects.filter(value__key__isnull=True) # This will
return also JSONFields without the `key`.
<QuerySet [<NullableJSONModel: NullableJSONModel object (14)>]>
>>> NullableJSONModel.objects.filter(value__key__in=[None])
<QuerySet []>
}}}
See [https://docs.djangoproject.com/en/3.1/topics/db/queries/#storing-and-
querying-for-none "Storing and querying for None"] and
[https://docs.djangoproject.com/en/3.1/topics/db/queries/#key-index-and-
path-transforms "Key, index, and path transforms"] docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/32078#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.