Exemplo n.º 1
0
 def get(self):
   result = memcache.get("words")
   if not result:
     result = simplejson.dumps(
       {"words": [ w.name for w in Word.all().fetch(1000) ]},
       ensure_ascii=False)
     memcache.add("words", result)
   
   self.response.content_type = "application/json"
   self.response.out.write(result)
   return
Exemplo n.º 2
0
    def get(self):

        template_values = {"words": Word.all().fetch(1000)}

        path = os.path.join(os.path.dirname(__file__), "..", "view", "index.html")
        self.response.out.write(template.render(path, template_values))