Add id to document request unit serializer context

This commit is contained in:
Keannu Bernasol 2024-11-25 00:32:55 +08:00
parent 9198867346
commit c9e6928e8a

View file

@ -59,8 +59,8 @@ class DocumentRequestUnitSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = DocumentRequestUnit model = DocumentRequestUnit
fields = ["document", "copies"] fields = ["id", "document", "copies"]
read_only_fields = ["document", "copies"] read_only_fields = ["id", "document", "copies"]
class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer): class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer):
@ -68,8 +68,8 @@ class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = DocumentRequestUnit model = DocumentRequestUnit
fields = ["document", "copies"] fields = ["id", "document", "copies"]
read_only_fields = ["document", "copies"] read_only_fields = ["id", "document", "copies"]
class DocumentRequestSerializer(serializers.ModelSerializer): class DocumentRequestSerializer(serializers.ModelSerializer):