django/django — pull request #21 by akaariai (2012-04-29 11:46:24+00:00)
Title: Simplified QuerySet field.null handling

QuerySet had previously some complex logic for dealing with nullable
fields in negated add_filter() calls. It seems the logic is leftover
from a time where the WhereNode wasn't as intelligent in handling
field__in=[] conditions.

All tests passed on SQLite. I believe all tests should pass on other
backends, too.

The reason why this should be fixed is that it is very hard to see what
is happening in the negated field.null case currently. I hope this patch
makes the logic and why the condition is added clearer