Ejemplo n.º 1
0
    def task_cards(self):
        cards = []
        for t in Task.objects.filter(user_story__iteration=self):
            card = {}
            card['TaskID'] = t.id
            card['TaskName'] = t.name
            card['TaskDescription'] = t.description
            card['TaskEstimate'] = _if_is_none_else(t.estimate, '?')
            card['TaskRemaining'] = _if_is_none_else(t.remaining, '?')

            if not t.owner:
                owner = 'Unassigned'
            elif t.owner.first_name or t.owner.last_name:
                owner = ' '.join([n for n in [t.owner.first_name, t.owner.last_name] if n])
            elif t.owner.email:
                owner = t.owner.email
            else:
                owner = t.owner.username
            card['TaskOwner'] = owner

            card['TaskTags'] = t.tags.replace('"', '')

            us = t.user_story

            card['StoryID'] = us.id
            card['StoryName'] = us.name
            card['StoryDescription'] = us.description
            card['StoryRank'] = _if_is_none_else(us.relative_rank, '?')

            cards.append(card)
        return cards
Ejemplo n.º 2
0
 def story_cards(self):
     cards = []
     for us in UserStory.objects.filter(iteration=self):
         card = {}
         card['StoryID'] = us.id
         card['StoryName'] = us.name
         card['StoryDescription'] = us.description
         card['StoryRank'] = _if_is_none_else(us.relative_rank, '?')
         card['StorySize'] = us.size_label
         cards.append(card)
     return cards
Ejemplo n.º 3
0
    def get_csv_row(self):

        pr = self.task.user_story.project
        it = self.task.user_story.iteration
        us = self.task.user_story

        return [self.date,
                "%s" % pr.name.encode('utf8'),
                "%s" % _if_is_none_else(it, 'Backlog', lambda x : x.name.encode('utf8')),
                "%s" % us.name.encode('utf8'),
                "%s" % self.task.name.encode('utf8'),
                self.owner.username,
                self.time_on_task,
                "%s" % self.summary.encode('utf8'),
               ]