Skip to content

Commit

Permalink
added id field to serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
kostomeister committed Nov 29, 2023
1 parent fe5cad2 commit c350d93
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cinema/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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):
Expand All @@ -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()
Expand Down

0 comments on commit c350d93

Please sign in to comment.