def get(self): photo_id = int(self.request.get('photo_id')) photo = Photo.query_by_id(photo_id) if photo: self.response.headers['Content-Type'] = 'image/png' self.response.out.write(photo.image) else: self.response.out.write('No image')
def get(self): PhotoDistances = [] streams = Stream.query() for stream in streams: for photo in stream.photos: p = Photo.query_by_id(photo) PhotoDistances.append({"lat":p.Latitude, "lng": p.Longitude, "stream_id":p.stream_id, "photo_id": photo, "stream_name": stream.name}) self.response.write(json.dumps({"Distances": PhotoDistances}))