def from_python(self, value):
        """
        Provide the ability to pass a RedisModel instances or a FK field as
        value instead of passing the PK. The value will then be translated in
        the real PK.
        """
        if isinstance(value, model.RedisModel):
            value = value._pk
        elif isinstance(value, SimpleValueRelatedFieldMixin):
            value = value.proxy_get()
        return value
def from_python ( self , value ) : if isinstance ( value , model . RedisModel ) : value = value . _pk elif isinstance ( value , SimpleValueRelatedFieldMixin ) : value = value . proxy_get ( ) return value
Provide the ability to pass a RedisModel instances or a FK field as
        value instead of passing the PK. The value will then be translated in
        the real PK.