def GET(self, id): default_headers() id = id[1:] program = model.get_program(id) if not program: raise web.notfound() return json.dumps(program.big())
def POST(self, id): form = new_program.form() program = model.get_program(int(id)) if not form.validates(): return render.edit(program, form) model.update_program(int(id), form.d.day,form.d.hour_ini, form.d.hour_end, form.d.temp) raise web.seeother('/list_programs')
def POST(self, id): form = new_program.form() program = model.get_program(int(id)) if not form.validates(): return render.edit(program, form) model.update_program(int(id), form.d.day, form.d.hour_ini, form.d.hour_end, form.d.temp) raise web.seeother('/list_programs')
def GET(self, id): program = model.get_program(int(id)) form = new_program.form() form.fill(program) return render.edit(program, form)