Improved performance of loading DateTimeField on Oracle and MySQL.
This commit is contained in:
parent
23a27f2c03
commit
c5a2f48bed
|
@ -219,6 +219,7 @@ class DatabaseOperations(BaseDatabaseOperations):
|
|||
elif internal_type in ['BooleanField', 'NullBooleanField']:
|
||||
converters.append(self.convert_booleanfield_value)
|
||||
elif internal_type == 'DateTimeField':
|
||||
if settings.USE_TZ:
|
||||
converters.append(self.convert_datetimefield_value)
|
||||
elif internal_type == 'UUIDField':
|
||||
converters.append(self.convert_uuidfield_value)
|
||||
|
@ -236,7 +237,6 @@ class DatabaseOperations(BaseDatabaseOperations):
|
|||
|
||||
def convert_datetimefield_value(self, value, expression, connection):
|
||||
if value is not None:
|
||||
if settings.USE_TZ:
|
||||
value = timezone.make_aware(value, self.connection.timezone)
|
||||
return value
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ END;
|
|||
elif internal_type in ['BooleanField', 'NullBooleanField']:
|
||||
converters.append(self.convert_booleanfield_value)
|
||||
elif internal_type == 'DateTimeField':
|
||||
if settings.USE_TZ:
|
||||
converters.append(self.convert_datetimefield_value)
|
||||
elif internal_type == 'DateField':
|
||||
converters.append(self.convert_datefield_value)
|
||||
|
@ -192,7 +193,6 @@ END;
|
|||
|
||||
def convert_datetimefield_value(self, value, expression, connection):
|
||||
if value is not None:
|
||||
if settings.USE_TZ:
|
||||
value = timezone.make_aware(value, self.connection.timezone)
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue