예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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()
예제 #4
0
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()