Beispiel #1
0
def update(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.project_edit(relation.project))
    data = request_data({'author': request.account})
    relation = relations.save(data, relation=relation)
    db.session.commit()
    return jsonify(relation)
Beispiel #2
0
def update(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.project_edit(relation.project))
    data = request_data({'author': request.account})
    relation = relations.save(data, relation=relation)
    db.session.commit()
    return jsonify(relations.to_rest(relation))
Beispiel #3
0
def delete(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.project_edit(relation.project))
    relations.delete(relation)
    db.session.commit()
    raise Gone()
Beispiel #4
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.project_read(relation.project))
    return jsonify(relation)
def relations_index(obj_id):
    query = Property.all()
    query = query.filter(Property.relation_id != None)
    obj = Relation.by_id(obj_id)
    query = query.filter_by(relation_id=obj_id)
    return _index(query, obj)
Beispiel #6
0
def view(id):
    relation = Relation.by_id(id)
    if relation is None:
        raise NotFound()
    return render_template("relation.html", relation=relation)
def view(id):
    relation = Relation.by_id(id)
    if relation is None:
        raise NotFound()
    return render_template('relation.html', relation=relation)
Beispiel #8
0
def delete(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.project_edit(relation.project))
    relations.delete(relation)
    db.session.commit()
    raise Gone()
Beispiel #9
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    return jsonify(relations.to_rest(relation))
Beispiel #10
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    return jsonify(relations.to_rest(relation))
Beispiel #11
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.relation_read(relation))
    return jsonify(relation)