Django

Code

Changeset 7467

Show
Ignore:
Timestamp:
04/26/08 00:06:21 (2 months ago)
Author:
mtredinnick
Message:

queryset-refactor: For custom Q-like objects, pass in the used_aliases
parameter (see [7462]) from Query.add_q() to their add_to_query() method. This
provides custom objects with the same context as Q's.

Files:

Legend:

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

    r7466 r7467  
    10091009        Can also be used to add anything that has an 'add_to_query()' method. 
    10101010        """ 
     1011        if used_aliases is None: 
     1012            used_aliases = set() 
    10111013        if hasattr(q_object, 'add_to_query'): 
    10121014            # Complex custom objects are responsible for adding themselves. 
    1013             q_object.add_to_query(self
     1015            q_object.add_to_query(self, used_aliases
    10141016            return 
    10151017 
     
    10201022            subtree = False 
    10211023        connector = AND 
    1022         if used_aliases is None: 
    1023             used_aliases = set() 
    10241024        for child in q_object.children: 
    10251025            if isinstance(child, Node):