def fix_object(value):
    """Fixes python objects so that they can be properly inserted into SQL queries"""
    if isinstance(value, str):
        return value.encode('utf-8')
    else:
        return value