Django

Code

Changeset 3019

Show
Ignore:
Timestamp:
05/31/06 09:52:33 (2 years ago)
Author:
adrian
Message:

Fixed #2038 -- QuerySet?._combine now combines where clause. Thanks, graham@darkcoding.net

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/query.py

    r2997 r3019  
    316316    def complex_filter(self, filter_obj): 
    317317        """Returns a new QuerySet instance with filter_obj added to the filters. 
    318         filter_obj can be a Q object (has 'get_sql' method) or a dictionary of  
     318        filter_obj can be a Q object (has 'get_sql' method) or a dictionary of 
    319319        keyword lookup arguments.""" 
    320320        # This exists to support framework features such as 'limit_choices_to', 
     
    381381        #   A.filter(args1).filter(args2) 
    382382        combined = other._clone() 
     383        if self._select: combined._select.update(self._select) 
     384        if self._where: combined._where.extend(self._where) 
     385        if self._params: combined._params.extend(self._params) 
     386        if self._tables: combined._tables.extend(self._tables) 
    383387        # If 'self' is ordered and 'other' isn't, propagate 'self's ordering 
    384388        if (self._order_by is not None and len(self._order_by) > 0) and \