コード例 #1
0
ファイル: dump_project.py プロジェクト: 6ft/taiga-back
    def handle(self, *args, **options):
        for project_slug in args:
            try:
                project = Project.objects.get(slug=project_slug)
            except Project.DoesNotExist:
                raise CommandError('Project "%s" does not exist' % project_slug)

            data = project_to_dict(project)
            print(self.renderer.render(data, renderer_context=self.renderer_context).decode('utf-8'))
コード例 #2
0
ファイル: dump_project.py プロジェクト: niibruce/taiga-back
    def handle(self, *args, **options):
        for project_slug in args:
            try:
                project = Project.objects.get(slug=project_slug)
            except Project.DoesNotExist:
                raise CommandError('Project "%s" does not exist' % project_slug)

            data = project_to_dict(project)
            with open('%s.json'%(project_slug), 'w') as outfile:
                self.renderer.render_to_file(data, outfile, renderer_context=self.renderer_context)
コード例 #3
0
    def handle(self, *args, **options):
        for project_slug in args:
            try:
                project = Project.objects.get(slug=project_slug)
            except Project.DoesNotExist:
                raise CommandError('Project "%s" does not exist' %
                                   project_slug)

            data = project_to_dict(project)
            with open('%s.json' % (project_slug), 'w') as outfile:
                self.renderer.render_to_file(
                    data, outfile, renderer_context=self.renderer_context)
コード例 #4
0
ファイル: dump_project.py プロジェクト: utngz/taiga-back
    def handle(self, *args, **options):
        for project_slug in args:
            try:
                project = Project.objects.get(slug=project_slug)
            except Project.DoesNotExist:
                raise CommandError('Project "%s" does not exist' %
                                   project_slug)

            data = project_to_dict(project)
            print(
                self.renderer.render(
                    data,
                    renderer_context=self.renderer_context).decode('utf-8'))
コード例 #5
0
ファイル: test_export.py プロジェクト: utngz/taiga-back
def test_export_user_story_finish_date(client):
    user_story = f.UserStoryFactory.create(finish_date="2014-10-22")
    finish_date = project_to_dict(
        user_story.project)["user_stories"][0]["finish_date"]
    assert finish_date == "2014-10-22T00:00:00+0000"
コード例 #6
0
ファイル: test_export.py プロジェクト: utngz/taiga-back
def test_export_issue_finish_date(client):
    issue = f.IssueFactory.create(finished_date="2014-10-22")
    finish_date = project_to_dict(issue.project)["issues"][0]["finished_date"]
    assert finish_date == "2014-10-22T00:00:00+0000"