Exemplo n.º 1
0
class devSampleDetailSerializer(serializers.ModelSerializer):
    user = UserDetailSerializer()
    inputDate = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
    devPartSample = devPartSampleSerializer(many = True)

    class Meta:
        model = devSample
        fields =("id",'sname','user', 'inputDate','Type','Origin','Factory','Model','Logo','function','picUrl','note','devPartSample')
Exemplo n.º 2
0
class exploSampleGCMSDetailSerializer(serializers.ModelSerializer):
    inputDate = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
    user = UserDetailSerializer()
    exploSampleGCMSFile = exploSampleGCMSFileSerializer(many=True)

    class Meta:
        model = exploSampleGCMS
        fields = ("id","exploSample","devDetect","methodDetect", "user","inputDate","exploSampleGCMSFile")
Exemplo n.º 3
0
class exploSampleFTIRDetailSerializer(serializers.ModelSerializer):
    # 被指向用related_name来连接
    exploSampleFTIRTestFile = exploSampleFTIRTestFileSerializer(many = True)
    # 自身的外键直接用serializer代替即可
    user = UserDetailSerializer()

    class Meta:
        model = exploSampleFTIR
        fields = ("id","exploSample","devDetect","methodDetect", "user","inputDate","exploSampleFTIRTestFile")
Exemplo n.º 4
0
class devPartSampleXRFDetailSerializer(serializers.ModelSerializer):
    # 被指向用related_name来连接
    devPartSampleXRFTestFile = devPartSampleXRFTestFileSerializer(many = True)
    # 自身的外键直接用serializer代替即可
    user = UserDetailSerializer()

    class Meta:
        model = devPartSampleXRF
        fields = ("id","devPartSample","devDetect","methodDetect", "user","inputDate","devPartSampleXRFTestFile")
Exemplo n.º 5
0
class devEviShapeDetailSerializer(serializers.ModelSerializer):
    user = UserDetailSerializer()
    inputDate = serializers.DateTimeField(read_only=True,
                                          format='%Y-%m-%d %H:%M')
    devShapeEvi = devShapeEviSerializer(many=True)

    class Meta:
        model = devEvi
        fields = ('id', 'evidenceName', 'caseName', 'user', 'inputDate',
                  'eviType', 'picUrl', 'Factory', 'Model', 'Logo', 'Color',
                  'Material', 'Shape', 'thickness', 'note', 'devShapeEvi')
Exemplo n.º 6
0
class devPartSampleDetailSerializer(serializers.ModelSerializer):
    user = UserDetailSerializer()
    inputDate = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
    devPartSampleFTIR = devPartSampleFTIRDetailSerializer(many = True)
    devPartSampleRaman = devPartSampleRamanDetailSerializer(many= True)
    devPartSampleXRF = devPartSampleXRFDetailSerializer(many= True)
    devShapeSample = devShapeSampleSerializer(many= True)

    class Meta:
        model = devPartSample
        fields = ("id",'sname', 'devSample','user','inputDate','sampleType','Origin','Factory','Model','Logo'
                  ,'function','Color','Material','Shape','thickness','picUrl','note','devPartSampleFTIR','devPartSampleRaman',
                  'devPartSampleXRF','devShapeSample')
Exemplo n.º 7
0
class exploEviDetailSerializer(serializers.ModelSerializer):
    user = UserDetailSerializer()
    inputDate = serializers.DateTimeField(read_only=True,
                                          format='%Y-%m-%d %H:%M')
    exploEviFTIR = exploEviFTIRDetailSerializer(many=True)
    exploEviRaman = exploEviRamanDetailSerializer(many=True)
    exploEviXRD = exploEviXRDDetailSerializer(many=True)
    exploEviXRF = exploEviXRFDetailSerializer(many=True)
    exploEviGCMS = exploEviGCMSDetailSerializer(many=True)

    class Meta:
        model = exploEvi
        fields = ('id', 'evidenceName', 'caseName', 'user', 'inputDate',
                  'picUrl', 'note', 'exploEviFTIR', 'exploEviRaman',
                  'exploEviXRD', 'exploEviXRF', 'exploEviGCMS')
Exemplo n.º 8
0
class exploSampleDetailSerializer(serializers.ModelSerializer):
    user = UserDetailSerializer()
    inputDate = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M')
    exploSampleFTIR = exploSampleFTIRDetailSerializer(many= True)
    exploSampleRaman = exploSampleRamanDetailSerializer(many= True)
    exploSampleXRD = exploSampleXRDDetailSerializer(many= True)
    exploSampleXRF = exploSampleXRFDetailSerializer(many= True)
    exploSampleGCMS = exploSampleGCMSDetailSerializer(many=True)

   # read_only前端写也写不进去!!!

    class Meta:
        model = exploSample
        fields =("id",'sname','snameAbbr','user','inputDate','sampleOrigin','factory','picUrl','note',
                 'exploSampleFTIR','exploSampleRaman','exploSampleXRD','exploSampleXRF','exploSampleGCMS')