Ticket #1754: __init__.py.diff

File __init__.py.diff, 648 bytes (added by Esaj, 19 years ago)
  • django/db/models/fields/__init__.py

     
    416416    def get_db_prep_lookup(self, lookup_type, value):
    417417        if lookup_type == 'range':
    418418            value = [str(v) for v in value]
    419         elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne'):
     419        elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne') and hasattr(value, 'strftime'):
    420420            value = value.strftime('%Y-%m-%d')
    421421        else:
    422422            value = str(value)
Back to Top