Skip to content

Instantly share code, notes, and snippets.

@darcyliu darcyliu/gist:918878
Created Apr 14, 2011

Embed
What would you like to do?
class HomeHandler(BaseRequestHandler):
def get(self):
nodes = memcache.get('nodes')
if nodes is None:
nodes = Node.all()
nodes.fetch(100)
nodes = self.snippet('nodes.html',{'nodes':nodes})
memcache.set('nodes', nodes, 1800)
topics = memcache.get('topics')
if topics is None:
topics = Topic.all()
topics.filter('ref =', None )
topics.order('-updated')
topics.fetch(100)
topics = self.snippet('topics.html',{'topics':topics})
memcache.set('topics', topics, 1800)
values = {'nodes':nodes,'topics':topics}
self.render('home.html',values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.