예제 #1
0
파일: sprint.py 프로젝트: meverone/intranet
 def dispatch(self):
     sprint_id = self.request.GET.get('sprint_id')
     sprint = Sprint.query.get(sprint_id)
     form = SprintForm(self.request.POST, obj=sprint)
     if self.request.method == 'POST' and form.validate():
         project_id = form.project_id.data
         project = Project.query.get(project_id)
         sprint.name = form.name.data
         sprint.client_id = project.client_id
         sprint.project_id = project.id
         sprint.team_id = form.team_id.data or None
         sprint.bugs_project_ids = map(int, form.bugs_project_ids.data)
         sprint.start = form.start.data
         sprint.end = form.end.data
         sprint.goal = form.goal.data
         sprint.retrospective_note = form.retrospective_note.data
         self.session.add(sprint)
         self.flash(self._(u"Sprint edited"))
         LOG(u"Sprint edited")
         url = self.request.url_for('/scrum/sprint/show', sprint_id=sprint.id)
         return HTTPFound(location=url)
     return dict(
         form=form,
         sprint=sprint
     )
예제 #2
0
 def dispatch(self):
     sprint_id = self.request.GET.get('sprint_id')
     sprint = Sprint.query.get(sprint_id)
     form = SprintForm(self.request.POST, obj=sprint)
     if self.request.method == 'POST' and form.validate():
         project_id = form.project_id.data
         project = Project.query.get(project_id)
         sprint.name = form.name.data
         sprint.client_id = project.client_id
         sprint.project_id = project.id
         sprint.team_id = form.team_id.data or None
         sprint.bugs_project_ids = map(int, form.bugs_project_ids.data)
         sprint.start = form.start.data
         sprint.end = form.end.data
         sprint.goal = form.goal.data
         sprint.board = form.board.data
         sprint.retrospective_note = form.retrospective_note.data
         DBSession.add(sprint)
         self.flash(self._(u"Sprint edited"))
         LOG(u"Sprint edited")
         if self.request.POST.get('save-and-go'):
             url = self.request.url_for('/scrum/sprint/board', sprint_id=sprint.id)
         else:
             url = self.request.url_for('/scrum/sprint/edit', sprint_id=sprint.id)
         return HTTPFound(location=url)
     return dict(
         form=form,
         sprint=sprint
     )
예제 #3
0
 def dispatch(self):
     form = SprintForm(self.request.POST)
     if self.request.method == 'POST' and form.validate():
         project = Project.query.get(int(form.project_id.data))
         sprint = Sprint(
             name=form.name.data,
             client_id=project.client_id,
             project_id=project.id,
             team_id=form.team_id.data or None,
             bugs_project_ids = map(int, form.bugs_project_ids.data),
             start=form.start.data,
             end=form.end.data,
             board=form.board.data,
             goal=form.goal.data,
             retrospective_note = form.retrospective_note.data,
         )
         DBSession.add(sprint)
         DBSession.flush()
         self.flash(self._(u"New sprint added"))
         LOG(u"Sprint added")
         url = self.request.url_for('/scrum/sprint/show', sprint_id=sprint.id)
         return HTTPFound(location=url)
     return dict(
         form=form,
     )
예제 #4
0
 def dispatch(self):
     sprint_id = self.request.GET.get("sprint_id")
     sprint = Sprint.query.get(sprint_id)
     form = SprintForm(self.request.POST, obj=sprint)
     if self.request.method == "POST" and form.validate():
         project_id = form.project_id.data
         project = Project.query.get(project_id)
         sprint.name = form.name.data
         sprint.client_id = project.client_id
         sprint.project_id = project.id
         sprint.team_id = form.team_id.data or None
         sprint.bugs_project_ids = map(int, form.bugs_project_ids.data)
         sprint.start = form.start.data
         sprint.end = form.end.data
         sprint.goal = form.goal.data
         sprint.board = form.board.data
         sprint.retrospective_note = form.retrospective_note.data
         DBSession.add(sprint)
         self.flash(self._(u"Sprint edited"))
         LOG(u"Sprint edited")
         if self.request.POST.get("save-and-go"):
             url = self.request.url_for("/scrum/sprint/board", sprint_id=sprint.id)
         else:
             url = self.request.url_for("/scrum/sprint/edit", sprint_id=sprint.id)
         return HTTPFound(location=url)
     return dict(form=form, sprint=sprint)
예제 #5
0
 def dispatch(self):
     sprint_id = self.request.GET.get('sprint_id')
     sprint = Sprint.query.get(sprint_id)
     form = SprintForm(self.request.POST, obj=sprint)
     if self.request.method == 'POST' and form.validate():
         project_id = int(form.project_id.data)
         project = Project.query.get(project_id)
         sprint.name = form.name.data
         sprint.client_id = project.client_id
         sprint.project_id = project.id
         sprint.start = form.start.data
         sprint.end = form.end.data
         sprint.goal = form.goal.data
         sprint.retrospective_note = form.retrospective_note.data
         self.session.add(sprint)
         self.flash(self._(u"Sprint edited"))
         LOG(u"Sprint edited")
         url = self.request.url_for('/scrum/sprint/show',
                                    sprint_id=sprint.id)
         return HTTPFound(location=url)
     return dict(form=form, sprint=sprint)