Esempio n. 1
0
 def post(self, group_id):
     form = GroupForm(self.request.arguments)
     if form.validate():
         group = Group.get(group_id)
         group.update(**form.data)
         group.save()
         self.redirect(self.reverse_url('group', group_id))
     else:
         self.redirect(self.reverse_url('group', group_id))
Esempio n. 2
0
 def post(self, group_id):
     form = GroupForm(self.request.arguments)
     if form.validate():
         group = Group.get(group_id)
         group.update(**form.data)
         group.save()
         self.redirect(self.reverse_url('group', group_id))
     else:
         self.redirect(self.reverse_url('group', group_id))
Esempio n. 3
0
 def post(self):
     form = GroupForm(self.request.arguments)
     if form.validate():
         group = Group(**form.data)
         user_id = self.get_current_user_id()
         user = User.get(user_id)
         user.groups.append(group)
         group.save()
         self.redirect(self.reverse_url('group', group.id))
     else:
         self.redirect(self.reverse_url('groups'))  # Todo エラーメッセージを渡す
Esempio n. 4
0
 def post(self):
     form = GroupForm(self.request.arguments)
     if form.validate():
         group = Group(**form.data)
         user_id = self.get_current_user_id()
         user = User.get(user_id)
         user.groups.append(group)
         group.save()
         self.redirect(self.reverse_url('group', group.id))
     else:
         self.redirect(self.reverse_url('groups'))  # Todo エラーメッセージを渡す