def get(self): images = model.get_all_images() image_list = [] for image in images: image_list.append(image) respond_template(self.response, 'search.html', {"images": simplejson.dumps(image_list)})
def get(self): images = model.get_all_images() data = {"images": []} for image in images: data["images"].append(get_img_root_url(self.request) + image) respond_json(self.response, self.request, data)
def get(self): try: nb_images = len(model.get_all_images()) image_name = model.get_random_image_name() image_url = get_img_root_url(self.request) + image_name respond_template(self.response, 'home.html', {"image_url": image_url, "nb_images": str(nb_images)}) except apiproxy_errors.OverQuotaError, message: logging.error(message) self.redirect("/static/oops.html")
def get(self): respond_template(self.response, 'view.html', {"images": model.get_all_images()})