Ticket #13882: django-orm-exclude-null.diff

File django-orm-exclude-null.diff, 834 bytes (added by Alex Gaynor, 14 years ago)
  • django/db/models/sql/query.py

    diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
    index 0913399..ec47744 100644
    a b class Query(object):  
    10901090                    # exclude the "foo__in=[]" case from this handling, because
    10911091                    # it's short-circuited in the Where class.
    10921092                    # We also need to handle the case where a subquery is provided
    1093                     entry = self.where_class()
    1094                     entry.add((Constraint(alias, col, None), 'isnull', True), AND)
    1095                     entry.negate()
    1096                     self.where.add(entry, AND)
     1093                    self.where.add((Constraint(alias, col, None), 'isnull', False), AND)
    10971094
    10981095        if can_reuse is not None:
    10991096            can_reuse.update(join_list)
Back to Top