query('INSERT INTO changelog ("table",id_value,id_key,field,value_new,value_old,"when",who,executed) VALUES (?,?,?,?,?,(SELECT %s FROM %s WHERE %s = ?),?,?,1)'%(column,tabs[table][0],tabs[table][1]),table,id,tabs[table][1],column,val,id,datetime.now(),session['user']['givenName'])
query('UPDATE %s SET %s = ? WHERE %s = ?'%(tabs[table][0],column,
tabs[table][1]),val,id)
query('COMMIT')
return"OK",200
...
...
@@ -254,4 +256,4 @@ def stats():
@register_navbar('Changelog','book')
@mod_required
deflog():
returnrender_template('log.html',changelog=query('SELECT *, ( "table" || "." || id_value || "." ||field) as path FROM changelog ORDER BY "when" LIMIT 10'))
returnrender_template('log.html',changelog=query('SELECT *, ( "table" || "." || id_value || "." ||field) as path FROM changelog ORDER BY "when"DESC LIMIT 50'))