1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

boulder-oracle-sprint: Fixed previous commit, which broke TimeField.get_db_pre_save for MySQL.

git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2007-05-16 16:52:40 +00:00
parent 8ccc894e17
commit a3c5889d93

View File

@ -844,7 +844,7 @@ class TimeField(Field):
# doesn't support microseconds.
if settings.DATABASE_ENGINE == 'mysql' and hasattr(value, 'microsecond'):
value = value.replace(microsecond=0)
elif settings.DATABASE_ENGINE == 'oracle':
if settings.DATABASE_ENGINE == 'oracle':
# cx_Oracle expects a datetime.datetime to persist into TIMESTAMP field.
if isinstance(value, datetime.time):
value = datetime.datetime(1900, 1, 1, value.hour, value.minute,