summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-19 17:56:53 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-19 17:56:53 +0000
commit3f549ca61d347d7513d4d6bf4ffb4aecedf2336c (patch)
treeffb90ca82fe9fc25fdf7fff0cea998252a860403 /django
parent1d3cc72d3ef010396a4c90a6737f841aafdbd3c2 (diff)
downloaddjango-3f549ca61d347d7513d4d6bf4ffb4aecedf2336c.tar.gz
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
Diffstat (limited to 'django')
-rw-r--r--django/db/models/query.py12
1 files 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'):