diff --git a/cinema/serializers.py b/cinema/serializers.py index 51ad1e11b..316cbb1d6 100644 --- a/cinema/serializers.py +++ b/cinema/serializers.py @@ -22,9 +22,6 @@ class Meta: class MovieSerializer(serializers.ModelSerializer): - actors = ActorSerializer(many=True) - genres = GenreSerializer(many=True) - class Meta: model = Movie - fields = "__any__" + fields = ("title", "description", "duration") diff --git a/cinema/views.py b/cinema/views.py index f114089c2..7735f6c8f 100644 --- a/cinema/views.py +++ b/cinema/views.py @@ -92,11 +92,18 @@ def delete(self, request, *args, **kwargs): return self.destroy(request, *args, **kwargs) -class CinemaHallView(viewsets.GenericViewSet): +class CinemaHallView( + mixins.ListModelMixin, + mixins.CreateModelMixin, + mixins.RetrieveModelMixin, + mixins.UpdateModelMixin, + mixins.DestroyModelMixin, + viewsets.GenericViewSet, +): queryset = CinemaHall.objects.all() serializer_class = CinemaHallSerializer -class MovieView(ModelViewSet): +class MovieView(viewsets.ModelViewSet): queryset = Movie.objects.all() serializer_class = MovieSerializer