Exemple #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)
Exemple #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))
Exemple #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()
Exemple #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)
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)
Exemple #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()
Exemple #9
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    return jsonify(relations.to_rest(relation))
Exemple #10
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    return jsonify(relations.to_rest(relation))
Exemple #11
0
def view(id):
    relation = object_or_404(Relation.by_id(id))
    authz.require(authz.relation_read(relation))
    return jsonify(relation)