Ticket #2473: in_empty_list.diff
File in_empty_list.diff, 708 bytes (added by , 18 years ago) |
---|
-
django/db/models/query.py
641 641 except KeyError: 642 642 pass 643 643 if lookup_type == 'in': 644 return '%s%s IN (%s)' % (table_prefix, field_name, ','.join(['%s' for v in value])) 644 ids = list(value) 645 if ids: 646 return '%s%s IN (%s)' % (table_prefix, field_name, ','.join(['%s' for id in ids])) 647 else: 648 return '0' 645 649 elif lookup_type == 'range': 646 650 return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name) 647 651 elif lookup_type in ('year', 'month', 'day'):