Browse files

Fixed #7312 -- Fixed handling of custom Q-like objects in QuerySet.c…


This is pretty much internal-use-only code, so doesn't affect public API at
all, but it's nice to be able to handle things properly in any case. Patch from

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
malcolmt committed Jun 26, 2008
1 parent 9e23c3c commit 36cb438373a264872e588ab615d8c22798ce0410
Showing with 3 additions and 1 deletion.
  1. +3 −1 django/db/models/
@@ -492,7 +492,9 @@ def complex_filter(self, filter_obj):
and usually it will be more natural to use other methods.
if isinstance(filter_obj, Q) or hasattr(filter_obj, 'add_to_query'):
- return self._filter_or_exclude(None, filter_obj)
+ clone = self._clone()
+ clone.query.add_q(filter_obj)
+ return clone
return self._filter_or_exclude(None, **filter_obj)

0 comments on commit 36cb438

Please sign in to comment.