[Solved]-Django Queryset __in with None value in list


a = M.objects.filter(Q(f__isnull=True) | Q(f__in=['1',...])) 


It seems to be and old bug in Django (https://code.djangoproject.com/ticket/13768).

I just made few tests with Django 1.5 and it still is there: ‘None’ gets ignored when used in a list applied to “__in” (no errors).

Catherine approach works like a charm 🙂


Leave a comment