﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33785	Broken __in lookup for keys of json field	Maksim Iakovlev	nobody	"For example I have a model with json field:

{{{
class MyModel():
    model_field = JsonField()
}}}

I create 3 records in db:

{{{
x1 = MyModel(model_field={json_field=''}).save()
x2 = MyModel(model_field={json_field=None}).save()
x3 = MyModel(model_field={json_field='foobar'}).save()
}}}

And then I want for filter all records which contains non-empty json_field like this:

{{{
MyModel.objects.exclude(model_field__json_field__in=['', None])
}}}

I expect only x3 record in result, but x2 presents too. This is also wrong:

{{{
MyModel.objects.exclude(model_field__json_field='').exclude(model_field__json_field__isnull=True)
}}}

Only this filter works as expected:

{{{
MyModel.objects.exclude(model_field__json_field='').exclude(model_field__json_field=None)
}}}"	Bug	closed	Database layer (models, ORM)	3.2	Normal	duplicate			Unreviewed	0	0	0	0	0	0
