Example #1
0
 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())
Example #2
0
 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')
Example #3
0
 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')
Example #4
0
 def GET(self, id):
     program = model.get_program(int(id))
     form = new_program.form()
     form.fill(program)
     return render.edit(program, form)
Example #5
0
 def GET(self, id):
     program = model.get_program(int(id))
     form = new_program.form()
     form.fill(program)
     return render.edit(program, form)