Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)