Skip to content

Commit

Permalink
Optimize the MovieSession queryset
Browse files Browse the repository at this point in the history
  • Loading branch information
molodsh1y1 committed Dec 11, 2024
1 parent 4a8da1e commit 3235d00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cinema/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def get_serializer_class(self):


class MovieSessionViewSet(viewsets.ModelViewSet):
queryset = MovieSession.objects
queryset = MovieSession.objects.select_related(
"movie", "cinema_hall"
)

def get_serializer_class(self):
if self.action == "list":
Expand Down

0 comments on commit 3235d00

Please sign in to comment.