Exemple #1
0
 def add_pipeline(self, args):
     """
     Add a new pipeline to the system.
     """
     data = {'name': args.name, 'plugin_tree': args.plugintree}
     if args.authors:
         data['authors'] = args.authors
     if args.category:
         data['category'] = args.category
     if args.description:
         data['description'] = args.description
     if args.unlock:
         data['locked'] = False
     pipeline_serializer = PipelineSerializer(data=data)
     pipeline_serializer.is_valid(raise_exception=True)
     owner = User.objects.get(username=args.owner)
     pipeline_serializer.save(owner=owner)
Exemple #2
0
 def modify_pipeline(self, args):
     """
     Modify an existing pipeline.
     """
     pipeline = self.get_pipeline(args.id)
     data = {}
     if args.name:
         data['name'] = args.name
     if args.authors:
         data['authors'] = args.authors
     if args.category:
         data['category'] = args.category
     if args.description:
         data['description'] = args.description
     if args.unlock:
         data['locked'] = False
     pipeline_serializer = PipelineSerializer(pipeline, data=data)
     pipeline_serializer.is_valid(raise_exception=True)
     pipeline_serializer.save()