title: cant seem to figure out the error: get_queryset() takes 1 positional argument but 2 were given
body: <p>I have a django rest framework project. I created a viewset and I am setting up the urls for the viewset. I am getting the following error:</p>
  
  <pre><code>TypeError at /api/v2/preferences/
  get_queryset() takes 1 positional argument but 2 were given
  </code></pre>
  
  <p>I am working with the preferences urls...</p>
  
  <pre><code>urlpatterns = [
      path('', include(router.urls)),
      path('dashboards/&lt;int:pk&gt;', dashboard_detail, name='dashboard-detail'),
      path('dashboards/&lt;str:guid&gt;', dashboard_detail, name='dashboard-detail'),
      path('users/&lt;int:pk&gt;/stacks/', person_stack, name='user-stacks'),
      path('preferences/&lt;str:namespace&gt;/&lt;str:path&gt;/&lt;int:pk&gt;/', user_preference_stack, 
           name='preferences-pk'),
      path('preferences/&lt;str:namespace&gt;/&lt;str:path&gt;/', user_preference_stack, 
           name='preferences-path'),
      path('preferences/&lt;str:namespace&gt;/', user_preference_stack, name='preferences-namespace'),
      path('preferences/', user_preference_stack, name='preferences')
  ]
  </code></pre>
  
  <p>I also wanted to know if it is possible to create 1 url with the namespace and path as optional and not required arguments rather than 4 urls with each variation of the url.
  here is the viewset:</p>
  
  <pre><code>class PreferenceUserViewSet(viewsets.ModelViewSet):
      model = Preference
      serializer_class = PreferenceSerializer
  
      def get_permissions(self):
          if self.action == 'create' or self.action == 'destroy' or self.action == 'list' or self.action == 'put':
              permission_classes = [IsAuthenticated]
          else:
              permission_classes = [IsAuthenticated]
          return [permission() for permission in permission_classes]
  
      def get_user(self):
          return self.request.user
  
      def get_queryset(self):
          namespace = self.kwargs.get('namespace', None)
          path = self.kwargs.get('path', None)
          if namespace is None and path is None:
              queryset = Preference.objects.all().filter(person=self.request.user.id)
          if namespace and path is None:
              queryset = Preference.objects.all().filter(
                  person=self.request.user.id,
                  namespace=namespace)
          if namespace and path:
              queryset = Preference.objects.all().filter(
                  person=self.request.user.id,
                  namespace=namespace,
                  path=path)
          return queryset
  
      def create(self, request, *args, **kwargs):
          namespace = self.kwargs.get('namespace', None)
          path = self.kwargs.get('path', None)
          if namespace is None and path is None:
              return super().create(request, *args, **kwargs)
          if namespace and path is None:
              data = {
                  "person": request.user.id,
                  'version': request.data.get('version'),
                  'namespace': namespace,
                  'path': request.data.get('path'),
                  'value': request.data.get('value'),
                  'user_id': request.user.id,
              }
  
          if namespace and path:
              data = {
                  "person": request.user.id,
                  'version': request.data.get('version'),
                  'namespace': namespace,
                  'path': path,
                  'value': request.data.get('value'),
                  'user_id': request.user.id,
              }
          serializer = self.get_serializer(data=data)
          serializer.is_valid(raise_exception=True)
          self.perform_create(serializer)
          headers = self.get_success_headers(serializer.data)
          return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
  
      def destroy(self, request, *args, **kwargs):
          namespace = self.kwargs.get('namespace', None)
          path = self.kwargs.get('path', None)
          if namespace and path:
              try:
                  instance = self.get_object()
                  self.perform_destroy(instance)
              except Http404:
                  pass
              return Response(status=status.HTTP_204_NO_CONTENT)
  
      def partial_update(self, request, *args, **kwargs):
          namespace = self.kwargs.get('namespace', None)
          path = self.kwargs.get('path', None)
          primary = self.kwargs.get('pk', None)
          instance = self.queryset.get(
              user_id=request.user.id,
              namespace=namespace,
              path=path,
              pk=primary)
          serializer = self.serializer_class(instance, data=request.data, partial=True)
          serializer.is_valid(raise_exception=True)
          serializer.save()
          return Response(serializer.data)
  </code></pre>
  
  <p>full stack track:</p>
  
  <pre><code>TypeError at /api/v2/preferences/
  get_queryset() takes 1 positional argument but 2 were given
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/api/v2/preferences/
  Django Version: 2.2.1
  Exception Type: TypeError
  Exception Value:    
  get_queryset() takes 1 positional argument but 2 were given
  Exception Location: C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rest_framework\views.py in dispatch, line 492
  Python Executable:  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\python.exe
  Python Version: 3.7.3
  Python Path:    
  ['C:\\Users\\jandali\\Desktop\\o-backend\\ozone-framework-python-server',
   'C:\\Users\\jandali\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
   'C:\\Users\\jandali\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
   'C:\\Users\\jandali\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
   'C:\\Users\\jandali\\AppData\\Local\\Programs\\Python\\Python37-32',
   'C:\\Users\\jandali\\AppData\\Roaming\\Python\\Python37\\site-packages',
   'C:\\Users\\jandali\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages']
  Server time:    Tue, 16 Jul 2019 19:32:02 +0000
  Traceback Switch to copy-and-paste view
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\exception.py in inner
              response = get_response(request) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\base.py in _get_response
                  response = self.process_exception_by_middleware(e, request) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\handlers\base.py in _get_response
                  response = wrapped_callback(request, *callback_args, **callback_kwargs) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\views\decorators\csrf.py in wrapped_view
          return view_func(*args, **kwargs) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rest_framework\viewsets.py in view
              return self.dispatch(request, *args, **kwargs) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rest_framework\views.py in dispatch
              response = self.handle_exception(exc) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rest_framework\views.py in handle_exception
              self.raise_uncaught_exception(exc) …
  ▶ Local vars
  C:\Users\jandali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rest_framework\views.py in dispatch
              response = handler(request, *args, **kwargs) …
  ▶ Local vars
  </code></pre>