Django

Code

Changeset 7344

Show
Ignore:
Timestamp:
03/21/08 08:53:37 (7 months ago)
Author:
mtredinnick
Message:

queryset-refactor: Removed an unneeded comparison to NULL for non-nullable
ForeignKey? field lookups.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/queryset-refactor/django/db/models/sql/query.py

    r7343 r7344  
    935935                self.where.negate() 
    936936            if final > 1 and lookup_type != 'isnull': 
    937                 j_col = self.alias_map[alias][RHS_JOIN_COL] 
    938                 entry = Node([(alias, j_col, None, 'isnull', True)]) 
    939                 entry.negate() 
    940                 self.where.add(entry, AND) 
     937                for alias in join_list: 
     938                    if self.alias_map[alias] == self.LOUTER: 
     939                        j_col = self.alias_map[alias][RHS_JOIN_COL] 
     940                        entry = Node([(alias, j_col, None, 'isnull', True)]) 
     941                        entry.negate() 
     942                        self.where.add(entry, AND) 
     943                        break 
    941944 
    942945    def add_q(self, q_object):