From d068ad0c01be9bb085c86a4e0c4dd047a85ce18d Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Thu, 8 Jan 2009 05:16:21 +0000 Subject: Using querysets as an rvalue in filter() calls was causing an unnecessary database query, due to a bool() call. This change stops that behaviour. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9715 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/sql/where.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django/db/models/sql/where.py') diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index a9fca7df11..9ce1e7bf2d 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -66,6 +66,8 @@ class WhereNode(tree.Node): # here in the future (using Python types is suggested for consistency). if isinstance(value, datetime.datetime): annotation = datetime.datetime + elif hasattr(value, 'value_annotation'): + annotation = value.value_annotation else: annotation = bool(value) -- cgit v1.3