1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

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
This commit is contained in:
Boulder Sprinters 2007-04-19 17:56:53 +00:00
parent 1d3cc72d3e
commit 3f549ca61d

View File

@ -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'):