Skip to content

Commit 9246279

Browse files
authored
Extend ReadOnlyModelViewSet with prefetch mixins
This change creates a ReadOnlyModelViewSet with the required prefetch mixins.
1 parent 409fb65 commit 9246279

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rest_framework_json_api/views.py

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class ModelViewSet(AutoPrefetchMixin, PrefetchForIncludesHelperMixin, viewsets.M
102102
pass
103103

104104

105+
class ReadOnlyModelViewSet(AutoPrefetchMixin,
106+
PrefetchForIncludesHelperMixin,
107+
viewsets.ReadOnlyModelViewSet):
108+
pass
109+
110+
105111
class RelationshipView(generics.GenericAPIView):
106112
serializer_class = ResourceIdentifierObjectSerializer
107113
self_link_view_name = None

0 commit comments

Comments
 (0)