summaryrefslogtreecommitdiff
path: root/django/db/backends/sqlite3/base.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-11-16 08:48:24 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-11-16 08:48:24 +0000
commit9d0bacebd2d0fc2b3581dac9acdc631338387921 (patch)
tree3b6c2f16bb3e7aea0e42b5d14bc3c945e64717a6 /django/db/backends/sqlite3/base.py
parent98ec741a03221e2b2a4c465e04ddede0795185af (diff)
Fixed #3501 -- Fixed date filtering in querysets for nullable date fields. Only
affects SQLite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/sqlite3/base.py')
-rw-r--r--django/db/backends/sqlite3/base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index f175bc4cb7..745f9982a0 100644
--- a/django/db/backends/sqlite3/base.py
+++ b/django/db/backends/sqlite3/base.py
@@ -101,7 +101,7 @@ class DatabaseOperations(BaseDatabaseOperations):
return [first % value, second % value]
class DatabaseWrapper(BaseDatabaseWrapper):
-
+
# SQLite requires LIKE statements to include an ESCAPE clause if the value
# being escaped has a percent or underscore in it.
# See http://www.sqlite.org/lang_expr.html for an explanation.
@@ -124,7 +124,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
def __init__(self, *args, **kwargs):
super(DatabaseWrapper, self).__init__(*args, **kwargs)
-
+
self.features = DatabaseFeatures()
self.ops = DatabaseOperations()
self.client = DatabaseClient()
@@ -179,6 +179,8 @@ class SQLiteCursorWrapper(Database.Cursor):
return query % tuple("?" * num_params)
def _sqlite_extract(lookup_type, dt):
+ if dt is None:
+ return None
try:
dt = util.typecast_timestamp(dt)
except (ValueError, TypeError):