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)
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
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)