mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
magic-removal: Fixed #1460 -- Fixed pub_date__lt behavior in SQLite. Thanks for the patch, Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ba273d88ac
commit
ce41a3e736
@ -351,6 +351,8 @@ class DateField(Field):
|
||||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
if lookup_type == 'range':
|
||||
value = [str(v) for v in value]
|
||||
elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne'):
|
||||
value = value.strftime('%Y-%m-%d')
|
||||
else:
|
||||
value = str(value)
|
||||
return Field.get_db_prep_lookup(self, lookup_type, value)
|
||||
@ -399,6 +401,13 @@ class DateTimeField(DateField):
|
||||
value = str(value)
|
||||
return Field.get_db_prep_save(self, value)
|
||||
|
||||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
if lookup_type == 'range':
|
||||
value = [str(v) for v in value]
|
||||
else:
|
||||
value = str(value)
|
||||
return Field.get_db_prep_lookup(self, lookup_type, value)
|
||||
|
||||
def get_manipulator_field_objs(self):
|
||||
return [forms.DateField, forms.TimeField]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user