Example #1
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        tps = TranslationProject.objects.live().order_by(
            "project__code", "language__code").select_related(
                "project",
                "language",
                "directory",
                "project__source_language")

        if not self.process_disabled_projects:
            tps = tps.exclude(project__disabled=True)

        if self.projects:
            tps = tps.filter(project__code__in=self.projects)

        if self.languages:
            tps = tps.filter(language__code__in=self.languages)

        for tp in tps.iterator():
            if options["atomic"] == "tp":
                with transaction.atomic():
                    self.do_translation_project(tp, **options)
            else:
                self.do_translation_project(tp, **options)
Example #2
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        if options["atomic"] == "tp":
            self._handle_atomic_tps(**options)
        else:
            self._handle_tps(**options)
Example #3
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        if options["atomic"] == "tp":
            self._handle_atomic_tps(**options)
        else:
            self._handle_tps(**options)
Example #4
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        if self.process_disabled_projects:
            project_query = Project.objects.all()
        else:
            project_query = Project.objects.enabled()

        if self.projects:
            project_query = project_query.filter(code__in=self.projects)

        for project in project_query.iterator():
            tp_query = project.translationproject_set.live() \
                              .order_by('language__code')

            if self.languages:
                tp_query = tp_query.filter(language__code__in=self.languages)

            for tp in tp_query.iterator():
                self.do_translation_project(tp, **options)
Example #5
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        if self.process_disabled_projects:
            project_query = Project.objects.all()
        else:
            project_query = Project.objects.enabled()

        if self.projects:
            project_query = project_query.filter(code__in=self.projects)

        for project in project_query.iterator():
            tp_query = project.translationproject_set.live() \
                              .order_by('language__code')

            if self.languages:
                tp_query = tp_query.filter(language__code__in=self.languages)

            for tp in tp_query.iterator():
                self.do_translation_project(tp, **options)
Example #6
0
    def handle_all(self, **options):
        if options["no_rq"]:
            set_sync_mode(options['noinput'])

        tps = TranslationProject.objects.live().order_by(
            "project__code",
            "language__code").select_related("project", "language",
                                             "directory",
                                             "project__source_language")

        if not self.process_disabled_projects:
            tps = tps.exclude(project__disabled=True)

        if self.projects:
            tps = tps.filter(project__code__in=self.projects)

        if self.languages:
            tps = tps.filter(language__code__in=self.languages)

        for tp in tps.iterator():
            self.do_translation_project(tp, **options)