Skip to content

Commit

Permalink
optimization: 流程执行方案支持更新操作
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Jul 19, 2023
1 parent bb51e98 commit dddf63c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gcloud/template_base/apis/drf/serilaziers/template_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""
from rest_framework import serializers
from typing import List

from rest_framework import serializers

from gcloud.template_base.models import DefaultTemplateScheme
from gcloud.utils.drf.serializer import ReadWriteSerializerMethodField

Expand All @@ -26,6 +27,12 @@ class SchemesSerizlializer(serializers.Serializer):
class TemplateSchemeSerializer(SchemesSerizlializer):
id = serializers.IntegerField(read_only=True, help_text="执行方案ID")

def update(self, instance, validated_data):
instance.data = validated_data["data"]
instance.name = validated_data["name"]
instance.save()
return instance


class ParamsSerializer(serializers.Serializer):
"""
Expand Down

0 comments on commit dddf63c

Please sign in to comment.