mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #7312 -- Fixed handling of custom Q-like objects in QuerySet.custom_filter().
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 emulbreh. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -492,7 +492,9 @@ class QuerySet(object): | |||||||
|         and usually it will be more natural to use other methods. |         and usually it will be more natural to use other methods. | ||||||
|         """ |         """ | ||||||
|         if isinstance(filter_obj, Q) or hasattr(filter_obj, 'add_to_query'): |         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 | ||||||
|         else: |         else: | ||||||
|             return self._filter_or_exclude(None, **filter_obj) |             return self._filter_or_exclude(None, **filter_obj) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user