Esempio n. 1
0
 def get(self, page_name):
     page = Page.get_by_name(page_name)
     if page:
         self.render('page.html', content=page.content,
             name=page.name,
             user=self.user)
     else:
         self.redirect('/_edit' + page_name)
Esempio n. 2
0
 def get(self, page_name):
     if not self.user:
         self.redirect('/login')
     page = Page.get_by_name(page_name)
     content = ''
     if page:
         content = page.content
     self.render('edit.html', content=content)
Esempio n. 3
0
 def post(self, page_name):
     content = self.request.get('content')
     page = Page.get_by_name(page_name)
     if page:
         page.content = content
     else:
         page = Page(name=page_name, content=content)
     page.put()
     self.redirect(page_name)