Ejemplo n.º 1
0
 def GET(self, id):
     form = group_form()
     group = get_group_byid(id)
     form.fill(group)
     users = get_users()
     group_users = group.users
     req = web.ctx.req
     req.update({"form": form, "users": users, "group_users": group_users})
     return render.group_edit(**req)
Ejemplo n.º 2
0
 def POST(self, id):
     form = group_form()
     if not form.validates():
         group = get_group_byid(id)
         form.fill(group)
         users = get_users()
         group_users = group.users
         req = web.ctx.req
         req.update({"form": form, "users": users, "group_users": group_users})
         return render.group_edit(**req)
     data = web.input(users=[])
     form_data = form.d
     form_data.uids = data.users
     save_group(int(id), form_data)
     raise web.seeother("/group/index")