new_contents: # -*- coding: utf-8 -*-
  from __future__ import absolute_import, division, print_function
  
  from rest_framework import fields, serializers
  
  from experiments.models import Experiment, ExperimentJob, ExperimentStatus
  
  
  class ExperimentJobStatusSerializer(serializers.ModelSerializer):
      uuid = fields.UUIDField(format='hex', read_only=True)
  
      class Meta:
          model = ExperimentStatus
          exclude = ('id',)
  
  
  class ExperimentJobSerializer(serializers.ModelSerializer):
      uuid = fields.UUIDField(format='hex', read_only=True)
      experiment = fields.SerializerMethodField()
  
      class Meta:
          model = ExperimentJob
          exclude = ('id',)
  
      def get_experiment(self, obj):
          return obj.experiment.uuid.hex
  
  
  class ExperimentStatusSerializer(serializers.ModelSerializer):
      uuid = fields.UUIDField(format='hex', read_only=True)
      experiment = fields.SerializerMethodField()
  
      class Meta:
          model = ExperimentStatus
          exclude = ('id',)
  
      def get_experiment(self, obj):
          return obj.experiment.uuid.hex
  
  
  class ExperimentSerializer(serializers.ModelSerializer):
      uuid = fields.UUIDField(format='hex', read_only=True)
      last_status = serializers.SerializerMethodField()
      user = fields.SerializerMethodField()
  
      class Meta:
          model = Experiment
          fields = ('uuid', 'user', 'name', 'created_at', 'updated_at',
                    'last_status', 'started_at', 'finished_at', 'is_clone',)
  
      def get_last_status(self, obj):
          return obj.last_status.status if obj.last_status else None
  
      def get_user(self, obj):
          return obj.user.username
  
  
  class ExperimentDetailSerializer(ExperimentSerializer):
      cluster = fields.SerializerMethodField()
      polyaxonfile = fields.SerializerMethodField()
      project = fields.SerializerMethodField()
      jobs = ExperimentJobSerializer(many=True)
  
      class Meta:
          model = Experiment
          fields = (
              'uuid', 'created_at', 'updated_at', 'cluster', 'project', 'user', 'name', 'last_status',
              'description', 'polyaxonfile', 'config', 'original_experiment', 'jobs', 'started_at',
              'finished_at', 'is_clone')
  
      def get_cluster(self, obj):
          return obj.cluster.uuid.hex
  
      def get_polyaxonfile(self, obj):
          return obj.polyaxonfile.uuid.hex if obj.polyaxonfile else None
  
      def get_project(self, obj):
          return obj.project.uuid.hex
  
  
  class StatusSerializer(serializers.Serializer):
      job_id = serializers.CharField()
      status = serializers.CharField()
  
subject: Add serializers