示例#1
0
    def run(self, serialized_executor, serialized_model, serialized_project,
            *args, **kwargs):
        executor = core_utils.deserialize_class(serialized_executor)
        model_cls = core_utils.deserialize_class(serialized_model)
        project = core_utils.deserialize_instance(serialized_project)

        for resource in model_cls.objects.filter(project=project):
            executor.execute(resource, async=False, force=True, **kwargs)
示例#2
0
 def queryset(self, request, queryset):
     if self.value():
         model = core_utils.deserialize_class(self.value())
         return queryset.filter(
             content_type=ContentType.objects.get_for_model(model)
         )
     return queryset
示例#3
0
 def run(self, serialized_executor, serialized_instance, *args, **kwargs):
     self.executor = utils.deserialize_class(serialized_executor)
     return super(PreApplyExecutorTask, self).run(serialized_instance,
                                                  *args, **kwargs)