Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 3f549ca61d347d7513d4d6bf4ffb4aecedf2336c 1 parent 1d3cc72
Boulder Sprinters authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 django/db/models/query.py
View
12 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'):
Please sign in to comment.
Something went wrong with that request. Please try again.