示例#1
0
    def process(self, request):
        story, tasks = Converter.text_to_django_story(
            self.cleaned_data['story'].replace(r'\r\n', r'\n'))
        if self.cleaned_data['id'] and self.cleaned_data['id'] != '':
            existing_story = models.Story.objects.get(
                id=self.cleaned_data['id'])
            story.created_by = request.user
            story.id = existing_story.id
            story.sprint = existing_story.sprint
            story.state = existing_story.state
            story.created_by = request.user
        else:
            existing_story = None
            story.state = 'BACKLOG'
            story.created_by = request.user
        story.save()

        for task in story.task_set.all():
            task.delete()

        for task in tasks:
            task.story = story
            task.save()

        return {'story': story}
示例#2
0
	def process(self, request):
		story, tasks = Converter.text_to_django_story(self.cleaned_data['story'].replace(r'\r\n', r'\n'))
		if self.cleaned_data['id'] and self.cleaned_data['id'] != '':
			existing_story = models.Story.objects.get(id=self.cleaned_data['id'])
			story.created_by = request.user
			story.id = existing_story.id
			story.sprint = existing_story.sprint
			story.state = existing_story.state
			story.created_by = request.user
		else:
			existing_story = None
			story.state = 'BACKLOG'
			story.created_by = request.user
		story.save()

		for task in story.task_set.all():
			task.delete()

		for task in tasks:
			task.story = story
			task.save()

		return {
			'story': story
		}
示例#3
0
	def setup(self, request, last_post=None, initial=None):
		if initial:
			self.fields['id'].initial = initial.id
			self.fields['story'].initial = Converter.django_story_to_text(initial, initial.task_set.all())
示例#4
0
 def setup(self, request, last_post=None, initial=None):
     if initial:
         self.fields['id'].initial = initial.id
         self.fields['story'].initial = Converter.django_story_to_text(
             initial,
             initial.task_set.all().order_by('id'))
示例#5
0
def storyparser_format(story):
	return Converter.django_story_to_text(story, story.task_set.all())
示例#6
0
def storyparser_format(story):
    return Converter.django_story_to_text(story, story.task_set.all())