def create_ajax_loader(model, session, name, field_name, options):
    attr = getattr(model, field_name, None)

    if attr is None:
        raise ValueError((model, field_name) % 'Model %s does not have field %s.')

    if not hasattr(attr, 'property') or not hasattr(attr.property, 'direction'):
        raise ValueError('%s.%s is not a relation.' % (model, field_name))

    remote_model = attr.prop.mapper.class_
    return QueryAjaxModelLoader(name, session, remote_model, **options)
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/sqla/ajax.py/create_ajax_loader/swapped operands of `%`