diff --git a/_modules/apis_core/generic/api_views.html b/_modules/apis_core/generic/api_views.html index ba51d4243..97405e93b 100644 --- a/_modules/apis_core/generic/api_views.html +++ b/_modules/apis_core/generic/api_views.html @@ -90,7 +90,7 @@
from rest_framework import viewsets
-from .serializers import serializer_factory
+from .serializers import serializer_factory, GenericHyperlinkedModelSerializer
from .helpers import first_match_via_mro
@@ -124,10 +124,11 @@ Source code for apis_core.generic.api_views
[docs]
def get_serializer_class(self):
- serializer_class = first_match_via_mro(
- self.model, path="serializers", suffix="Serializer"
- ) or serializer_factory(self.model)
- return serializer_class
+ serializer_class = (
+ first_match_via_mro(self.model, path="serializers", suffix="Serializer")
+ or GenericHyperlinkedModelSerializer
+ )
+ return serializer_factory(self.model, serializer=serializer_class)