Django rest framework, should be able to override get_queryset and not define queryset attribute?
<p>I am confused. Looking through the ViewSet source code it looks like I should be able to not define a queryset in a viewset and then just override the get queryset function to get whatever queryset I want. But my code fails with this error:</p>

<pre><code>AssertionError: `base_name` argument not specified, and could not automatically determine the name from the viewset, as it does not have a `.queryset` attribute.
</code></pre>

<p>So even if I override the queryset attribute I still need to set it to some fake attribute in the beginning... this works, but it feels weird to define the queryset and then just override it a second later.</p>

<pre><code>class StudyQuestion(viewsets.ReadOnlyModelViewSet):
    queryset = Model.objects.all()
    serializer_class = ModelSerializer
    permission_classes = (permissions.IsAuthenticated, )

    def get_queryset(self):
        """"""
        return Model.objects.order_by('-word__frequency')
</code></pre>

<p>DRF Router is complaining, because it can't <a href="http://www.django-rest-framework.org/api-guide/routers/" rel="nofollow">automatically generate a basename for the viewset</a>:</p>

<blockquote>
  <p><strong>base_name</strong> - The base to use for the URL names that are created. If unset the basename will be automatically generated based on the queryset attribute of the viewset, if it has one. Note that if the viewset does not include a queryset attribute then you must set base_name when registering the viewset.</p>
</blockquote>

python django django-rest-framework