          Return the django-filters `FilterSet` used to filter the queryset.
          """
          filter_class = getattr(view, 'filter_class', None)
          filter_fields = getattr(view, 'filter_fields', None)
          model_cls = getattr(view, 'model', None)
          queryset = getattr(view, 'queryset', None)
          if model_cls is None and queryset is not None:
              model_cls = queryset.model
  
          if filter_class:
              filter_model = filter_class.Meta.model
  
              assert issubclass(filter_model, model_cls), \
 
</s> remove     def get_filter_class(self, view):
 </s> add     def get_filter_class(self, view, queryset=None): </s> remove             assert issubclass(filter_model, model_cls), \
                'FilterSet model %s does not match view model %s' % \
                (filter_model, model_cls)
 </s> add             assert issubclass(filter_model, queryset.model), \
                'FilterSet model %s does not match queryset model %s' % \
                (filter_model, queryset.model) </s> remove         filter_class = self.get_filter_class(view)
 </s> add         filter_class = self.get_filter_class(view, queryset) </s> remove                     model = model_cls
 </s> add                     model = queryset.model </s> remove             assert model_cls is not None, 'Cannot use DjangoFilterBackend ' \
                'on a view which does not have a .model or .queryset attribute.'

 </s> add 
          Return the django-filters `FilterSet` used to filter the queryset.
          """
          filter_class = getattr(view, 'filter_class', None)
          filter_fields = getattr(view, 'filter_fields', None)




  
          if filter_class:
              filter_model = filter_class.Meta.model
  
              assert issubclass(filter_model, model_cls), \
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Base automatic filterset model on the queryset model.  Fixes #834. 
rest_framework/filters.py