示例#1
0
 def get(self):
     all_stuff = self.request.GET.get('all', False)
     x_coord = self.request.GET.get('x_coord', 0)
     y_coord = self.request.GET.get('y_coord', 0)
     centre = (y_coord, x_coord)
     if all_stuff:
         stuffes = Stuff.get_all()
     else:
         stuffes = Stuff.get_near(centre, 100)
     return self.render('list_stuff.html', stuffes=stuffes, centre=centre)
示例#2
0
 def get(self):
     x_coord = self.request.GET.get('x_coord', 0)
     y_coord = self.request.GET.get('y_coord', 0)
     stuffes = Stuff.get_near((x_coord, y_coord), 100)
     self.response.content_type = 'application/json'
     self.response.write(stuffes_to_json(stuffes))