Ejemplo n.º 1
0
 def put(self, *args):
     path_elements = [x for x in self.request.path.split("/") if x]
     game = Game(self.request.body)
     game.id = path_elements[0]
     game.save()
     self.set_header('Content-Type', 'application/json')
     self.finish(game.toJSON())
Ejemplo n.º 2
0
 def post(self):
     g = Game(self.request.body)
     g.id = id_generator()
     g.save()
     self.set_header('Content-Type', 'application/json')
     self.finish(g.toJSON())