def update(id): entity = object_or_404(Entity.by_id(id)) authz.require(authz.entity_edit(entity)) data = request_data({'author': request.account}) entity = entities.save(data, files=request.files, entity=entity) db.session.commit() return jsonify(entity)
def delete(id): entity = object_or_404(Entity.by_id(id)) authz.require(authz.entity_edit(entity)) entities.delete(entity) db.session.commit() raise Gone()