def GET(self, id): f = linkForm() link = self.getLink(id) f.name.value = link.name f.url.value = link.url f.description.value = link.description d['f'] = f d['link'] = link return render.link_edit(**d)
def POST(self, id): f = linkForm() if f.validates(): link = self.getLink(id) link.name = f.name.value link.url = f.url.value link.description = f.description.value return web.seeother('/link/list/') else: d['f'] = f return render.link_edit(**d)