value = result.unhex
return value

def python_value(self, value):
    if value is None:
        return None
query = SelectQuery(self.model_class, fn.HEX(value).alias('hex'))
result = query.first()
value = '{}-{}-{}-{}-{}'.format(result.hex[0:8], result.hex[8:12], result.
    hex[12:16], result.hex[16:20], result.hex[20:32])
return value
peewee + MySQL, How to create a custom field type that wraps SQL-built ins?