Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit ce41a3e736f78b26ae57e524613dfc12569bc08d 1 parent ba273d8
Adrian Holovaty adrianholovaty authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 django/db/models/fields/__init__.py
9 django/db/models/fields/__init__.py
View
@@ -351,6 +351,8 @@ def __init__(self, verbose_name=None, name=None, auto_now=False, auto_now_add=Fa
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 @@ def get_db_prep_save(self, value):
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]
Please sign in to comment.
Something went wrong with that request. Please try again.