Django

Code

Changeset 6868

Show
Ignore:
Timestamp:
12/03/07 15:10:55 (7 months ago)
Author:
mtredinnick
Message:

queryset-refactor: Fixed disjunctions of empty result sets. Refs #6074.

Files:

Legend:

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

    r6866 r6868  
    4343        result = [] 
    4444        result_params = [] 
     45        empty = True 
    4546        for child in node.children: 
    4647            if hasattr(child, 'as_sql'): 
     
    6162                        # We can bail out early in this particular case (only). 
    6263                        raise 
    63                     sql = None 
     64                    elif node.negated: 
     65                        empty = False 
     66                    continue 
     67            empty = False 
    6468            if sql: 
    6569                result.append(format % sql) 
    6670                result_params.extend(params) 
     71        if empty: 
     72            raise EmptyResultSet 
    6773        conn = ' %s ' % node.connector 
    6874        return conn.join(result), result_params