Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/mysql/connector/django/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ def validate_autopk_value(self, value):
'value for AutoField.')
return value

if django.VERSION > (1, 8):
def adapt_datetimefield_value(self, value):
return self.value_to_db_datetime(value)

def value_to_db_datetime(self, value):
if value is None:
return None
Expand All @@ -202,6 +206,10 @@ def value_to_db_datetime(self, value):
return datetime_to_mysql(value)
return self.connection.converter.to_mysql(value)

if django.VERSION > (1, 8):
def adapt_timefield_value(self, value):
return self.value_to_db_time(value)

def value_to_db_time(self, value):
if value is None:
return None
Expand Down