

def python_value(self, value):
    if isinstance(value, self.rel_model):
        return value
    return self.to_field.python_value(value)

dataset/ETHPy150Open coleifer/peewee/peewee.py ForeignKeyField.python_value/original