from django.db import models


class ZeroDateTimeField(models.DateTimeField):

    def get_db_prep_value(self, value, connection, prepared=False):
        if not prepared:
            value = self.get_prep_value(value)
if value is None:
    return '0000-00-00 00:00:00'
else:
    return connection.ops.value_to_db_datetime(value)
Django ORM, Insert None datetime as 0 into MySQL