  
              return filter_class
  
          if filter_fields:
              assert model_cls is not None, 'Cannot use DjangoFilterBackend ' \
                  'on a view which does not have a .model or .queryset attribute.'
  
              class AutoFilterSet(self.default_filter_set):
                  class Meta:
                      model = model_cls
                      fields = filter_fields
              return AutoFilterSet
 
</s> remove                     model = model_cls
 </s> add                     model = queryset.model </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         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
 </s> add 
  
              return filter_class
  
          if filter_fields:



              class AutoFilterSet(self.default_filter_set):
                  class Meta:
                      model = model_cls
                      fields = filter_fields
              return AutoFilterSet
keep keep keep keep replace replace replace keep keep keep keep keep
 Base automatic filterset model on the queryset model.  Fixes #834. 
rest_framework/filters.py