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)
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')
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')
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) # 回头把这个改成另一个页面
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)