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