When the ref_cls argument passed to the Manager.get_related_objects function is neither Outgoing nor Incoming, the calling application fails with a LocalUnboundError which states that rel_query has not been defined.
Looking at the code at...
https://github.com/onefinestay/kaiso/blob/master/kaiso/persistence.py#L854
...it seems that inserting a simple else clause that raises a ValueError after line 859 could present a more meaningful error message in this case.