def __init__(self, *args, **kwargs): super(PipelineSerializer, self).__init__(*args, **kwargs) # Set the querysets of the related model fields. curr_user = self.context["request"].user # LOGGER.debug("PL SERIALIZER INIT %s" % self.context.get("only_is_published", False)) revision_parent_field = self.fields["revision_parent"] revision_parent_field.queryset = Pipeline.filter_by_user(curr_user) family_field = self.fields["family"] family_field.queryset = PipelineFamily.filter_by_user(curr_user)
def _choose_inputs_for_batch(request, pipeline_pk, start_form=None, input_error_message=''): """Load the input selection page.""" template = loader.get_template("sandbox/choose_inputs.html") pipeline_qs = Pipeline.filter_by_user(request.user).filter(pk=pipeline_pk) pipeline = pipeline_qs.first() if pipeline is None: raise Http404("ID {} is not accessible".format(pipeline_pk)) if start_form is None: start_form = StartRunBatchForm({"pipeline": pipeline}, pipeline_qs=pipeline_qs) context = {"inputs": pipeline.inputs.order_by("dataset_idx"), "start_form": start_form, "input_error_msg": input_error_message, "pipeline": pipeline, "priolist": [t[0] for t in settings.SLURM_QUEUES]} return HttpResponse(template.render(context, request))
def _choose_inputs_for_batch(request, pipeline_pk, start_form=None, input_error_message=''): """Load the input selection page.""" template = loader.get_template("sandbox/choose_inputs.html") pipeline_qs = Pipeline.filter_by_user(request.user).filter(pk=pipeline_pk) pipeline = pipeline_qs.first() if pipeline is None: raise Http404("ID {} is not accessible".format(pipeline_pk)) if start_form is None: start_form = StartRunBatchForm({"pipeline": pipeline}, pipeline_qs=pipeline_qs) context = { "inputs": pipeline.inputs.order_by("dataset_idx"), "start_form": start_form, "input_error_msg": input_error_message, "pipeline": pipeline, "priolist": [t[0] for t in settings.SLURM_QUEUES] } return HttpResponse(template.render(context, request))