Django

Code

Changeset 7274

Show
Ignore:
Timestamp:
03/17/08 14:31:42 (6 months ago)
Author:
ikelly
Message:

Fixed #6666: Corrected a bind param formatting issue when performing 'year' lookups on DateFields? using Oracle.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/db/models/fields/__init__.py

    r7150 r7274  
    231231            if settings.DATABASE_ENGINE == 'sqlite3': 
    232232                first = '%s-01-01' 
     233                second = '%s-12-31 23:59:59.999999' 
     234            elif settings.DATABASE_ENGINE == 'oracle' and self.get_internal_type() == 'DateField': 
     235                first = '%s-01-01' 
     236                second = '%s-12-31' 
    233237            else: 
    234238                first = '%s-01-01 00:00:00' 
    235             return [first % value, '%s-12-31 23:59:59.999999' % value] 
     239                second = '%s-12-31 23:59:59.999999' 
     240            return [first % value, second % value] 
    236241        raise TypeError("Field has invalid lookup: %s" % lookup_type) 
    237242