ajax 呼び出しで複数の Python 関数をトリガーするとします。複数の応答を受け取る方法はありますか (それらがすべて成功したことを示すために)。抽象的な例:
function triggerPython(){
$.ajax({
url:"/triggerPython",
type:'POST',
data: whatever,
success: function(response){
alert(response);
}
});
}
パイソン:
class triggerPython(webapp.RequestHandler):
def post(self):
function_1()
self.response.out("Function 1 done!")
function_2()
self.response.out("Function 2 done!")
function_3()
self.response.out("Function 3 done!")