From c9e6928e8a63a2d6fc57d886e121eca7d8f43105 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 25 Nov 2024 00:32:55 +0800 Subject: [PATCH] Add id to document request unit serializer context --- docmanager_backend/document_requests/serializers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docmanager_backend/document_requests/serializers.py b/docmanager_backend/document_requests/serializers.py index c6cd5f2..3ecd738 100644 --- a/docmanager_backend/document_requests/serializers.py +++ b/docmanager_backend/document_requests/serializers.py @@ -59,8 +59,8 @@ class DocumentRequestUnitSerializer(serializers.ModelSerializer): class Meta: model = DocumentRequestUnit - fields = ["document", "copies"] - read_only_fields = ["document", "copies"] + fields = ["id", "document", "copies"] + read_only_fields = ["id", "document", "copies"] class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer): @@ -68,8 +68,8 @@ class DocumentRequestUnitWithFileSerializer(serializers.ModelSerializer): class Meta: model = DocumentRequestUnit - fields = ["document", "copies"] - read_only_fields = ["document", "copies"] + fields = ["id", "document", "copies"] + read_only_fields = ["id", "document", "copies"] class DocumentRequestSerializer(serializers.ModelSerializer):