Skip to content

Commit

Permalink
Fixed bugs with incorrect halls link and router object
Browse files Browse the repository at this point in the history
  • Loading branch information
ORENYT committed Oct 11, 2023
1 parent 166282c commit 2014dcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 1 addition & 4 deletions cinema/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
11 changes: 9 additions & 2 deletions cinema/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2014dcd

Please sign in to comment.