mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
boulder-oracle-sprint: Removed django_empty_set_in_where.patch from ticket #3053 in favor of the trunk's patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5034 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
7495b05b12
commit
943189a45d
@ -771,11 +771,11 @@ def get_where_clause(lookup_type, table_prefix, field_name, value):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
if lookup_type == 'in':
|
if lookup_type == 'in':
|
||||||
if value:
|
in_string = ','.join(['%s' for id in value])
|
||||||
value_set = ','.join(['%s' for v in value])
|
if in_string:
|
||||||
|
return '%s%s IN (%s)' % (table_prefix, field_name, in_string)
|
||||||
else:
|
else:
|
||||||
value_set = 'NULL'
|
raise EmptyResultSet
|
||||||
return '%s%s IN (%s)' % (table_prefix, field_name, value_set)
|
|
||||||
elif lookup_type in ('range', 'year'):
|
elif lookup_type in ('range', 'year'):
|
||||||
return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name)
|
return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name)
|
||||||
elif lookup_type in ('month', 'day'):
|
elif lookup_type in ('month', 'day'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user