I have a field in an data object that can be either null or set to some integer. I want, given an integer, to filter all the objects with that integer value OR none:
MyElements.objects.all().filter(value__in=[myInt, None])
However, this line does not work for elements with null value. More precisely:
MyElements.objects.all().filter(value__in=[None])
returns nothing. whereas
MyElements.objects.all().filter(value = None)
returns the null-valued elements.
How can I rewrite the original query (which involves myInt) correctly?