Beispiel #1
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.new(form)
     
     model.new_page(form.d.url , form.d.title , form.d.content)
     raise web.seeother('/'+form.d.url)
Beispiel #2
0
 def post(self, path):
     if self.user:
         page = model.get_page(path)
         content = self.request.get('content')
         if not page:
             author = self.user.name
             model.new_page(author=author, path=path, content=content)
         else:
             editor = self.user.name
             model.edit_page(path=path, editor=editor, content=content)
         self.redirect('%s' % path)
     else:
         self.write('Not Logged in')
Beispiel #3
0
 def post(self, path):
     if self.user:
         page = model.get_page(path)
         content = self.request.get('content')
         if not page:
             author = self.user.name
             model.new_page(author = author, path = path, content = content)
         else:
             editor = self.user.name
             model.edit_page(path = path, editor = editor, content = content)
         self.redirect('%s' % path)
     else:
         self.write('Not Logged in')
Beispiel #4
0
 def POST(self):
     form = self.form()
     if form.validates():
         return render.new(form)
     model.new_page(form.d.url, form.d.title, form.d.content)
     raise web.seeother("/" + form.d.url)  # 回头把这个改成另一个页面
Beispiel #5
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.new(form)
     model.new_page(form.d.url, form.d.title, form.d.content)
     raise web.seeother('/' + form.d.url)