Commits

daehee han  committed 2c713cd

json

  • Participants
  • Parent commits 46e47c7

Comments (0)

Files changed (1)

File ktmt_insert.py

 import cgi
 import os
+import json
 
 from google.appengine.api import users
 from google.appengine.ext import webapp
     entity = EntityDict()
 
     if not users.get_current_user():
-      self.response.out.write('<html>NOT OK</html>')
+      #self.response.out.write('<html>NOT OK</html>')
+      res = {"result": "NOK", "error": "login required"}
+      self.response.out.write(json.dumps(res))
       return
 		
     entity.eid = int(self.request.get('eid'))
     entity.ehtype = self.request.get('ehtype')
     entity.parent = int(self.request.get('parent'))
     entity.put()
-    self.response.out.write('<html>OK</html>')
+
+    res = {"result": "OK"}
+    self.response.out.write(json.dumps(res))
+
+    #self.response.out.write('<html>OK</html>')
     #self.redirect('/')