Example #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)
Example #2
0
 def POST(self):
     form = group_form()
     if not form.validates():
         users = get_users()
         req = web.ctx.req
         req.update({"form": form, "users": users, "group_users": []})
         return render.group_edit(**req)
     data = web.input(users=[])
     form_data = form.d
     form_data.uids = data.users
     save_group(-1, form_data)
     raise web.seeother("/group/index")
Example #3
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")
Example #4
0
 def GET(self):
     form = group_form()
     users = get_users()
     req = web.ctx.req
     req.update({"form": form, "users": users, "group_users": []})
     return render.group_edit(**req)