Django

Code

Changeset 2851

Show
Ignore:
Timestamp:
05/05/06 22:27:49 (2 years ago)
Author:
adrian
Message:

Fixed #1777 -- Fixed bug in date conversion in SQLite backend. Thanks, dart@google.com

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/backends/sqlite3/base.py

    r2809 r2851  
    1212Database.register_converter("date", util.typecast_date) 
    1313Database.register_converter("datetime", util.typecast_timestamp) 
     14Database.register_converter("timestamp", util.typecast_timestamp) 
     15Database.register_converter("TIMESTAMP", util.typecast_timestamp) 
    1416 
    1517def utf8rowFactory(cursor, row): 
     
    3638        from django.conf import settings 
    3739        if self.connection is None: 
    38             self.connection = Database.connect(settings.DATABASE_NAME, detect_types=Database.PARSE_DECLTYPES) 
    39             # register extract and date_trun functions 
     40            self.connection = Database.connect(settings.DATABASE_NAME, 
     41                detect_types=Database.PARSE_DECLTYPES | Database.PARSE_COLNAMES) 
     42 
     43            # Register extract and date_trunc functions. 
    4044            self.connection.create_function("django_extract", 2, _sqlite_extract) 
    4145            self.connection.create_function("django_date_trunc", 2, _sqlite_date_trunc)