I had similar problems to you, but I found that it didn't work to put dummy data like that in the ajax call ... so here's my ajax call
function save(id) {
var data_in = {};
data_in['item_id'] = id;
data_in['id'] = other_uid;
data_in['name'] = other_name;
$$.post("/save", data_in, function(data_out) {
$$("#result").html(data_out);
});
}
Build the structure in javascript, then just pass it in "data_in" variable. jQuery knows how to send it.
Then in the python:
input = web.input()
cursor.execute("SELECT * FROM users WHERE id = '" + input['id'] + "'")
cursor.execute("INSERT INTO users(id, name) VALUES (%s, %s)", (user_id, input['name']))
cursor.execute("INSERT INTO user_goal_association(user_id, goal_id, completed) VALUES (%s, %s, now())", (user_id, input['goal_id']))
I can access the structure with input[fieldname]
Good tool for debugging is to throw this in just before you have the problem
import pdb; pdb.set_trace()
Then look at the console where your server is running and you can poke around
http://docs.python.org/library/pdb.html