From 3f549ca61d347d7513d4d6bf4ffb4aecedf2336c Mon Sep 17 00:00:00 2001 From: Boulder Sprinters Date: Thu, 19 Apr 2007 17:56:53 +0000 Subject: [PATCH] boulder-oracle-sprint: Fixed application of django_empty_set_in_where.patch from ticket #3053. git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5031 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/query.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/django/db/models/query.py b/django/db/models/query.py index 6f899c799a..3680c661c6 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -771,15 +771,11 @@ def get_where_clause(lookup_type, table_prefix, field_name, value): except KeyError: pass if lookup_type == 'in': - in_string = ','.join(['%s' for id in value]) - if in_string: - if value: - value_set = ','.join(['%s' for v in value]) - else: - value_set = 'NULL' - return '%s%s IN (%s)' % (table_prefix, field_name, value_set) + if value: + value_set = ','.join(['%s' for v in value]) else: - raise EmptyResultSet + value_set = 'NULL' + return '%s%s IN (%s)' % (table_prefix, field_name, value_set) elif lookup_type in ('range', 'year'): return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name) elif lookup_type in ('month', 'day'):