Ticket #1460: datefield-lookup.diff
File datefield-lookup.diff, 1.0 KB (added by , 19 years ago) |
---|
-
django/db/models/fields/__init__.py
341 341 def get_db_prep_lookup(self, lookup_type, value): 342 342 if lookup_type == 'range': 343 343 value = [str(v) for v in value] 344 elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne'): 345 value = value.strftime('%Y-%m-%d') 344 346 else: 345 347 value = str(value) 346 348 return Field.get_db_prep_lookup(self, lookup_type, value) … … 389 391 value = str(value) 390 392 return Field.get_db_prep_save(self, value) 391 393 394 def get_db_prep_lookup(self, lookup_type, value): 395 if lookup_type == 'range': 396 value = [str(v) for v in value] 397 else: 398 value = str(value) 399 return Field.get_db_prep_lookup(self, lookup_type, value) 400 392 401 def get_manipulator_field_objs(self): 393 402 return [forms.DateField, forms.TimeField] 394 403