def POST(self, id): form = self.form() page = tmw.get_page_by_id(int(id)) if not form.validates(): return render.edit(page, form) tmw.update_page(int(id), form.d.url, form.d.title, form.d.content) raise web.seeother('/wiki/%s' % form.d.url)
def GET(self, id): page = tmw.get_page_by_id(int(id)) form = self.form() form.fill(page) return render.edit(page, form)