'Transform a value to something compatible with the backend driver.
This method only depends on the type of the value. It\'s designed for
cases where the target type isn\'t known, such as .raw() SQL queries.
As a consequence it may not work perfectly in all circumstances.'

def adapt_unknown_value(self, value):

    if isinstance(value, datetime.datetime):
        return self.adapt_datetimefield_value(value)
    elif isinstance(value, datetime.date):
        return self.adapt_datefield_value(value)
    elif isinstance(value, datetime.time):
        return self.adapt_timefield_value(value)
    elif isinstance(value, decimal.Decimal):
        return self.adapt_decimalfield_value(value)
    else:
        return value
