          if serializer_class is not None:
              return serializer_class
  
          class DefaultSerializer(self.model_serializer_class):
              class Meta:
                  model = self.model or self.queryset.model
                  fields = self.fields
          return DefaultSerializer
 
</s> remove                 model = self.model
 </s> add                 model = self.model or self.queryset.model </s> remove         paginator = self._paginator_class(queryset, page_size,
                                          allow_empty_first_page=self.allow_empty)
 </s> add         paginator = self.paginator_class(queryset, page_size,
                                         allow_empty_first_page=self.allow_empty) </s> remove             model = BasicModel
 </s> add             queryset = BasicModel.objects.all() </s> remove             model = BasicModel
 </s> add             queryset = BasicModel.objects.all() </s> remove Using explict `queryset` and `serializer_class` attributes makes the functioning of the view more clear than using the shortcut `model` attribute.
 </s> add Using an explict `queryset` attribute makes the functioning of the view more clear than using the shortcut `model` attribute.
        assert self.model is not None or self.queryset is not None, \
            "'%s' should either include a 'serializer_class' attribute, " \
            "or use the 'queryset' or 'model' attribute as a shortcut for " \
            "automatically generating a serializer class." \
            % self.__class__.__name__

          if serializer_class is not None:
              return serializer_class
  
        assert self.model is not None or self.queryset is not None, \
            "'%s' should either include a 'serializer_class' attribute, " \
            "or use the 'queryset' or 'model' attribute as a shortcut for " \
            "automatically generating a serializer class." \
            % self.__class__.__name__

          class DefaultSerializer(self.model_serializer_class):
              class Meta:
                  model = self.model or self.queryset.model
                  fields = self.fields
          return DefaultSerializer
keep keep add keep keep keep keep keep
 Tweaks for preferring .queryset over .model 
rest_framework/generics.py