diff --git a/representatives_votes/api.py b/representatives_votes/api.py index 193c65c2609103b76eac6ed094839cd47c1f95f3..c277322f5c8713d559e0d0a9b92f811154043346 100644 --- a/representatives_votes/api.py +++ b/representatives_votes/api.py @@ -61,7 +61,7 @@ class ProposalViewSet(viewsets.ReadOnlyModelViewSet): API endpoint that allows proposals to be viewed. """ - queryset = Proposal.objects.all() + queryset = Proposal.objects.select_related('dossier') serializer_class = ProposalSerializer filter_backends = ( @@ -103,7 +103,7 @@ class VoteViewSet(viewsets.ReadOnlyModelViewSet): API endpoint that allows proposals to be viewed. """ - queryset = Vote.objects.all() + queryset = Vote.objects.select_related('representative', 'proposal') serializer_class = VoteSerializer filter_backends = (