Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #1777 -- Fixed bug in date conversion in SQLite backend. Thanks…

…, dart@google.com

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit eb4bbbb6f3346f49b25930ef6a32ce0a7b1ae3ec 1 parent f57e34e
@adrianholovaty adrianholovaty authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 django/db/backends/sqlite3/base.py
View
8 django/db/backends/sqlite3/base.py
@@ -11,6 +11,8 @@
Database.register_converter("time", util.typecast_time)
Database.register_converter("date", util.typecast_date)
Database.register_converter("datetime", util.typecast_timestamp)
+Database.register_converter("timestamp", util.typecast_timestamp)
+Database.register_converter("TIMESTAMP", util.typecast_timestamp)
def utf8rowFactory(cursor, row):
def utf8(s):
@@ -35,8 +37,10 @@ def __init__(self):
def cursor(self):
from django.conf import settings
if self.connection is None:
- self.connection = Database.connect(settings.DATABASE_NAME, detect_types=Database.PARSE_DECLTYPES)
- # register extract and date_trun functions
+ self.connection = Database.connect(settings.DATABASE_NAME,
+ detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES)
+
+ # Register extract and date_trunc functions.
self.connection.create_function("django_extract", 2, _sqlite_extract)
self.connection.create_function("django_date_trunc", 2, _sqlite_date_trunc)
cursor = self.connection.cursor(factory=SQLiteCursorWrapper)
Please sign in to comment.
Something went wrong with that request. Please try again.