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))
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 エラーメッセージを渡す