Exemplo n.º 1
0
 def GET(self):
     form = field_form()
     data = web.input()
     mid = data.mid
     req = web.ctx.req
     req.update({
         'form': form,
         'mid': mid,
         })
     return render.field_edit(**req)
Exemplo n.º 2
0
 def GET(self, id):
     form = field_form()
     field = get_field(id)
     form.fill(field)
     data = web.input()
     mid = data.mid
     req = web.ctx.req
     req.update({
         'form': form,
         'mid': mid,
         })
     return render.field_edit(**req)
Exemplo n.º 3
0
 def POST(self, id):
     form = field_form()
     data = web.input()
     mid = data.mid
     if not form.validates():
         req = web.ctx.req
         req.update({
             'form': form,
             'mid': mid,
             })
         return render.field_edit(**req)
     save_field(int(id), form.d)
     raise web.seeother('/model/%s/edit' % mid)