

def ensure_join(self, lm, rm, on=None):
    ctx = self._query_ctx
    for join in self._joins.get(lm, []):
        if (join.dest == rm):
            return self
    return self.switch(lm).join(on, on=on).switch(ctx)

dataset/ETHPy150Open coleifer/peewee/peewee.py Query.ensure_join/VarMisuse@67/75 `rm`->`on`