Exemplo n.º 1
0
    def handle(self, *args, **options):
        use_sandbox = options['use_sandbox']
        project_name = options['project']

        queryset = Manager_Projects.get_all()

        if project_name is not None:
            queryset = queryset.filter(name=project_name)

        for project in queryset:

            self.stdout.write(
                self.style.SUCCESS('Syncing project {} with {} HITs'.format(
                    project.name,
                    HIT.objects.filter(batch__project=project).count())))
            Manager_Batches.sync_mturk(project, use_sandbox)
Exemplo n.º 2
0
    def patch(self,
              request,
              slug_project,
              database_object_project,
              use_sandbox,
              format=None):
        result = Manager_Batches.sync_mturk(database_object_project,
                                            use_sandbox)
        # list_batches_changed = Manager_Batches.sync_mturk(database_object_project, use_sandbox)
        # serializer = Serializer_Batch(list_batches_changed, many=True)

        return Response(result)