diff -ruN django.branch/db/models/query.py django/db/models/query.py
old
|
new
|
|
662 | 662 | except KeyError: |
663 | 663 | pass |
664 | 664 | if lookup_type == 'in': |
665 | | return '%s%s IN (%s)' % (table_prefix, field_name, ','.join(['%s' for v in value])) |
| 665 | if value: |
| 666 | value_set = ','.join(['%s' for v in value]) |
| 667 | else: |
| 668 | value_set = 'NULL' |
| 669 | return '%s%s IN (%s)' % (table_prefix, field_name, value_set) |
666 | 670 | elif lookup_type == 'range': |
667 | 671 | return '%s%s BETWEEN %%s AND %%s' % (table_prefix, field_name) |
668 | 672 | elif lookup_type in ('year', 'month', 'day'): |