def METHOD_NAME(role, model_name):
    if model_name:
        perms = role.fieldpermission_set.filter(model_name=model_name)
    else:
        perms = role.fieldpermission_set.all()
    return list(perms)