Ticket #2031: mysql_microsecond.patch
File mysql_microsecond.patch, 789 bytes (added by , 18 years ago) |
---|
-
django/db/models/fields/__init__.py
471 471 # Casts dates into string format for entry into database. 472 472 if value is not None: 473 473 # MySQL will throw a warning if microseconds are given, because it 474 # doesn't support microseconds .475 if settings.DATABASE_ENGINE == 'mysql' :474 # doesn't support microsecondss. 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)