Django

Code

Changeset 3183

Show
Ignore:
Timestamp:
06/20/06 23:13:48 (2 years ago)
Author:
mtredinnick
Message:

Fixed #2031 -- Don't try to remove microseconds on date objects (only datetime)
for MySQL. Refs #316.

Files:

Legend:

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

    r3113 r3183  
    476476            # MySQL will throw a warning if microseconds are given, because it 
    477477            # doesn't support microseconds. 
    478             if settings.DATABASE_ENGINE == 'mysql'
     478            if settings.DATABASE_ENGINE == 'mysql' and hasattr(value, 'microsecond')
    479479                value = value.replace(microsecond=0) 
    480480            value = str(value)