Commit 0dc29c2d authored by Julian Rother's avatar Julian Rother
Browse files

Simplified usage of edit api

parent 67786ef6
......@@ -245,8 +245,12 @@ def edit():
'comment', 'internal'])
}
query('BEGIN TRANSACTION')
for key, val in request.get_json():
table, column, id = key.split('.', 2)
if request.is_json():
changes = request.get_json().items()
else:
changes = request.args.items()
for key, val in changes:
table, id, column = key.split('.', 2)
assert table in tabs
assert column in tabs[table][2]
query('UPDATE %s SET %s = ? WHERE %s = ?'%(tabs[table][0], column,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment