238 | | lookup_kwargs = { |
239 | | '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), |
240 | | } |
| 238 | lookup_kwargs = {} |
| 239 | from django.db.models.fields import DateTimeField |
| 240 | if isinstance(model._meta.get_field(date_field), DateTimeField): |
| 241 | lookup_kwargs['%s__range' % date_field] = (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), |
| 242 | else: |
| 243 | lookup_kwargs[date_field] = date |
307 | | lookup_kwargs = { |
308 | | '%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), |
309 | | } |
| 310 | lookup_kwargs = {} |
| 311 | from django.db.models.fields import DateTimeField |
| 312 | if isinstance(model._meta.get_field(date_field), DateTimeField): |
| 313 | lookup_kwargs['%s__range' % date_field] = (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), |
| 314 | else: |
| 315 | lookup_kwargs[date_field] = date |