def has_multiple_pks(model):
    """
        Return True, if the model has more than one primary key
    """
    if not hasattr(model, '_sa_class_manager'):
        raise TypeError('model must be a sqlalchemy mapped model')

    return 1 > len(model._sa_class_manager.mapper.primary_key)
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/sqla/tools.py/has_multiple_pks/swapped operands of `>`