Пример #1
0
 def get_route_json(self):
     params = { 
               'type': self.transport.type if self.transport != None else 'Walk', 
               'start': self.start_location, 
               'end': self.end_location,
               'startIcon': self.start_icon,
               'endIcon': self.end_icon,
               'startName': self.start_name,
               'endName': self.end_name
              }
     return utils.to_json(params)
Пример #2
0
def to_json(data, response):
    text = utils.to_json(data)
    response.headers['Content-Type'] = 'application/json; charset=utf-8'
    response.write(text)