Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Stekloduv committed Oct 29, 2024
1 parent caba329 commit 3d38cb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cinema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def __str__(self):
class Movie(models.Model):
title = models.CharField(max_length=255)
description = models.CharField(max_length=255)
genres = models.ManyToManyField(Genre)
actors = models.ManyToManyField(Actor)
genres = models.ManyToManyField(Genre, related_name='movies')
actors = models.ManyToManyField(Actor, related_name="movies")
duration = models.IntegerField()
2 changes: 1 addition & 1 deletion cinema/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def update(self, instance, validated_data):
class MovieSerializer(serializers.Serializer):
id = serializers.IntegerField(read_only=True)
title = serializers.CharField(max_length=255)
description = serializers.CharField()
description = serializers.CharField(max_length=255)
duration = serializers.IntegerField()
actors = serializers.PrimaryKeyRelatedField(
many=True, queryset=Actor.objects.all()
Expand Down

0 comments on commit 3d38cb1

Please sign in to comment.