Ticket #2031: mysql_microsecond.2.patch
File mysql_microsecond.2.patch, 676 bytes (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
472 472 if value is not None: 473 473 # MySQL will throw a warning if microseconds are given, because it 474 474 # doesn't support microseconds. 475 if settings.DATABASE_ENGINE == 'mysql' :475 if settings.DATABASE_ENGINE == 'mysql' and hasattr(value, 'microsecond'): 476 476 value = value.replace(microsecond=0) 477 477 value = str(value) 478 478 return Field.get_db_prep_save(self, value)