Пример #1
0
    def get(self, story_id, line_id):
        story = Story.get_by_story_id(story_id)
        story_line = StoryLine.get_by_id(int(line_id), parent=story)
        story_line.is_deleted = True
        story_line.deleted_by_user = users.get_current_user()
        story_line.put()

        self.redirect('/s/' + story_id)
Пример #2
0
    def post(self, story_id):

        story = Story.get_by_story_id(story_id)

        date_match = re.search(r'(\d\d\d\d)-(\d\d)-(\d\d)', self.request.get('date'))
        year = int(date_match.group(1))
        month = int(date_match.group(2))
        day = int(date_match.group(3))
        date = datetime.date(year, month, day)
        java_hours = int(self.request.get('java_hours'))
        cs_hours = int(self.request.get('cs_hours'))
        comment = self.request.get('comment')
        
        story_line = StoryLine(story_id=story_id,
                               comment=comment,
                               date=date,
                               user=users.get_current_user(),
                               java_hours=java_hours,
                               cs_hours=cs_hours,
                               parent=story)
        
        story_line.put()
        story.last_updated = story_line.date
        story.put()

        java_days = story.actual_java_days()
        cs_days = story.actual_cs_days()

        if story.java_estimate > 0 and story.java_estimate < java_days:
            logging.warn("Over java estimate")

        if story.cs_estimate > 0 and story.cs_estimate < cs_days:
            logging.warn("Over cs estimate")


        self.redirect('/s/' + story_id)