def get(self): """Returns the top 10 taches template""" taches = get_top_taches() template_values = { 'page-title': 'Top 10 Taches', 'taches': taches, 'ranking_type': 'Top', } self.render_template(template_values)
def get(self): """Returns the top 10 taches template""" top10 = memcache.get("top10") if top10 is not None: self.response.out.write(top10) else: taches = get_top_taches() template_values = { 'page-title': 'Top 10 Taches', 'taches': taches, 'ranking_type': 'Top', } rendered = self.render_template_memcache(template_values) if not memcache.add("top10", rendered, 240): logging.error("Memcache set failed.") self.response.out.write(rendered)