예제 #1
0
 def create_edit(self,page,content):
     """makes new edit in db and updates memcache"""
     logging.info('CREATE_EDIT')
     e = WikiEdit.create(page, content)
     created = e.created
     old_cache = memcache.get(page + 'edits') or []
     memcache.set(page + 'edits',old_cache.append((content,created)))
예제 #2
0
 def get(self,page):
     logging.info('history.get()')
     edits = WikiEdit.by_page(page)
     color = self.white_grey()
     n = len(edits)
     edit_info = [(n-i,e.created,e.content,color.next()) for i,e in enumerate(edits)]
     logging.info('edits are %s' %edit_info)
     self.render('wiki_history.html', page=page, edits=edit_info, in_out=self.in_out)
예제 #3
0
 def get_page_edits(self,page):
     return memcache.get(page + 'edits') or WikiEdit.by_page(page)