Django

Code

Changeset 5046

Show
Ignore:
Timestamp:
04/20/07 12:31:42 (2 years ago)
Author:
bouldersprinters
Message:

boulder-oracle-sprint: Fixed #4093 and added tests that cover it and the tricky datetime
fields.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/boulder-oracle-sprint/django/db/backends/oracle/base.py

    r5028 r5046  
    455455 
    456456        def resolve_columns(self, row, fields=()): 
    457             from django.db.models.fields import DateField, DateTimeField, TimeField 
     457            from django.db.models.fields import DateField, DateTimeField, \ 
     458                TimeField, BooleanField, NullBooleanField 
    458459            values = [] 
    459460            for value, field in map(None, row, fields): 
     
    465466                if value == ' ': 
    466467                    value = '' 
     468                # Convert 1 or 0 to True or False 
     469                elif value in (1, 0) and isinstance(field, (BooleanField, NullBooleanField)): 
     470                    value = bool(value) 
    467471                # cx_Oracle always returns datetime.datetime objects for 
    468472                # DATE and TIMESTAMP columns, but Django wants to see a 
  • django/branches/boulder-oracle-sprint/django/db/models/fields/__init__.py

    r5036 r5046  
    538538            if settings.DATABASE_ENGINE in ('mysql', 'oracle') and hasattr(value, 'microsecond'): 
    539539                value = value.replace(microsecond=0) 
     540            value = str(value) 
    540541        return Field.get_db_prep_save(self, value) 
    541542