def need_join(model, table):
    """
        Check if join to a table is necessary.
    """
    return model._sa_class_manager.mapper.tables not in table
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/sqla/tools.py/need_join/swapped operands of `not in`