Beispiel #1
0
def edit(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    html = render_template('dataset/edit.html',
                           dataset=dataset,
                           algorithms=get_algorithms())
    return htmlfill.render(html, defaults=dataset.as_dict())
Beispiel #2
0
def edit(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    html = render_template('dataset/edit.html',
                           dataset=dataset,
                           algorithms=get_algorithms())
    return htmlfill.render(html, defaults=dataset.as_dict())
Beispiel #3
0
def get_authz():
    permissions = {}
    dataset_name = request.args.get('dataset')
    if dataset_name is not None:
        dataset = Dataset.find(dataset_name)
        permissions[dataset_name] = {
            'view': True,
            'edit': authz.dataset_edit(dataset),
            'manage': authz.dataset_manage(dataset)
        }
    return jsonify(permissions)
Beispiel #4
0
def get_authz():
    permissions = {}
    dataset_name = request.args.get('dataset')
    if dataset_name is not None:
        dataset = Dataset.find(dataset_name)
        permissions[dataset_name] = {
            'view': True,
            'edit': authz.dataset_edit(dataset),
            'manage': authz.dataset_manage(dataset)
        }
    return jsonify(permissions)
Beispiel #5
0
def get_authz():
    permissions = {}
    dataset_name = request.args.get("dataset")
    if dataset_name is not None:
        dataset = Dataset.find(dataset_name)
        permissions[dataset_name] = {
            "view": True,
            "edit": authz.dataset_edit(dataset),
            "manage": authz.dataset_manage(dataset),
        }
    return jsonify(permissions)
Beispiel #6
0
def update(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    data = request_content()
    try:
        dataset.update(data)
        db.session.commit()
        flash("Updated %s" % dataset.label, "success")
        return redirect(url_for(".view", dataset=dataset.name))
    except Invalid, inv:
        return handle_invalid(inv, edit, args=[dataset.name], data=data)
Beispiel #7
0
def update(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    data = request_content()
    try:
        flush_cache(dataset)
        dataset.update(data)
        db.session.commit()
        flash("Updated %s" % dataset.label, 'success')
        return redirect(url_for('.view', dataset=dataset.name))
    except Invalid, inv:
        return handle_invalid(inv, edit, args=[dataset.name], data=data)
Beispiel #8
0
def delete(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    dataset.delete()
    db.session.commit()
    return ('', 204)
Beispiel #9
0
def update(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    dataset.update(request_data())
    db.session.commit()
    return redirect(url_for('.view', dataset=dataset.name))
Beispiel #10
0
def update(dataset):
    dataset = Dataset.find(dataset)
    authz.require(authz.dataset_manage(dataset))
    dataset.update(request_data())
    db.session.commit()
    return redirect(url_for('.view', dataset=dataset.name))