Commit 45518a05 authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 192c726e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -380,6 +380,10 @@ class QuerySet(object):
        #  (so that A.filter(args1) & A.filter(args2) does the same as
        #   A.filter(args1).filter(args2)
        combined = other._clone()
        if self._select: combined._select.update(self._select)
        if self._where: combined._where.extend(self._where)
        if self._params: combined._params.extend(self._params)
        if self._tables: combined._tables.extend(self._tables)
        # If 'self' is ordered and 'other' isn't, propagate 'self's ordering
        if (self._order_by is not None and len(self._order_by) > 0) and \
           (combined._order_by is None or len(combined._order_by) == 0):