From c350d931a8f698915e6e346270de05dd7bd6bd47 Mon Sep 17 00:00:00 2001 From: Kostia Date: Wed, 29 Nov 2023 11:14:52 +0200 Subject: [PATCH] added id field to serializers --- cinema/serializers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cinema/serializers.py b/cinema/serializers.py index 1949ab4cd..2bcec956f 100644 --- a/cinema/serializers.py +++ b/cinema/serializers.py @@ -51,6 +51,7 @@ def update(self, instance, validated_data): class ActorSerializer(serializers.Serializer): + id = serializers.IntegerField(read_only=True) first_name = serializers.CharField(max_length=64) last_name = serializers.CharField(max_length=64) @@ -72,6 +73,7 @@ def update(self, instance, validated_data): class GenreSerializer(serializers.Serializer): + id = serializers.IntegerField(read_only=True) name = serializers.CharField(max_length=64) def create(self, validated_data): @@ -84,6 +86,7 @@ def update(self, instance, validated_data): class CinemaHallSerializer(serializers.Serializer): + id = serializers.IntegerField(read_only=True) name = serializers.CharField(max_length=64) rows = serializers.IntegerField() seats_in_row = serializers.IntegerField()