diff --git a/beat/web/plotters/api.py b/beat/web/plotters/api.py index 940083c42f4213a1d257035a691756bb7a5d1b3b..eb27a9970bb835e9e3d80c6303ae66d8529dea2a 100644 --- a/beat/web/plotters/api.py +++ b/beat/web/plotters/api.py @@ -50,6 +50,8 @@ from django.shortcuts import get_object_or_404 from django.utils import six from django.core.exceptions import ValidationError +import json + class ListPlotterView(ListContributionView): """ List all available plotters @@ -299,6 +301,9 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi if (short_description is not None) and (len(short_description) > self.model._meta.get_field('short_description').max_length): raise serializers.ValidationError({'short_description': 'Short description too long'}) + customdata = None + if data.has_key('customdata'): + customdata = json.dumps(data['customdata']) # Process the query string if request.GET.has_key('fields'): @@ -335,6 +340,10 @@ class RetrieveUpdateDestroyPlotterParametersView(RetrieveUpdateDestroyContributi if plotter is not None: dbplotterparameter.plotter = plotter + # Modification of the parameters + if customdata is not None: + dbplotterparameter.data = customdata + # Save the plotterparameter model try: dbplotterparameter.save() diff --git a/beat/web/plotters/static/plotters/app/directives/plotterparameterItemView.js b/beat/web/plotters/static/plotters/app/directives/plotterparameterItemView.js index c943b2120b4697eec64b38bb0b8dcd85818af36b..397312294cabf2adeb6e5d59ad8e4cbbbdb0385c 100644 --- a/beat/web/plotters/static/plotters/app/directives/plotterparameterItemView.js +++ b/beat/web/plotters/static/plotters/app/directives/plotterparameterItemView.js @@ -168,7 +168,7 @@ app.directive("saveplotterparameter", function() else { //console.log($("#plotter-selection").find(":selected").text()); - console.log(scope.plotters.selected); + //console.log(scope.plotters.selected); scope.plotterparameterData.plotter = scope.plotters.selected.id; updatePlotterParameter(); @@ -177,6 +177,10 @@ app.directive("saveplotterparameter", function() else { //plotter is selected: parameter tuning + scope.plotterparameterData.plotter = scope.plotters.selected.id; + scope.plotterparameterData.customdata = scope.plotterparams_update; + + updatePlotterParameter(); } });