  class FilterFieldsRootView(generics.ListCreateAPIView):
      model = FilterableItem
      filter_fields = ['decimal', 'date']
  
  
  # These class are used to test a filter class.
  class SeveralFieldsFilter(django_filters.FilterSet):
      text = django_filters.CharFilter(lookup_type='icontains')
      decimal = django_filters.NumberFilter(lookup_type='lt')
      date = django_filters.DateFilter(lookup_type='gt')
      class Meta:
          model = FilterableItem
          fields = ['text', 'decimal', 'date']
  
  
  class FilterClassRootView(generics.ListCreateAPIView):
 
</s> remove         fields = ['text', 'decimal', 'date']
 </s> add         filter_fields = ['decimal', 'date'] </s> remove class FilterClassRootView(generics.ListCreateAPIView):
    model = FilterableItem
    filter_class = SeveralFieldsFilter
 </s> add         class Meta:
            model = FilterableItem
            fields = ['text', 'decimal', 'date'] </s> remove # Basic filter on a list view.
class FilterFieldsRootView(generics.ListCreateAPIView):
    model = FilterableItem
    filter_fields = ['decimal', 'date']
 </s> add 
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
  class FilterFieldsRootView(generics.ListCreateAPIView):
      model = FilterableItem
      filter_fields = ['decimal', 'date']
  
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
if django_filters:
    # Basic filter on a list view.
    class FilterFieldsRootView(generics.ListCreateAPIView):
          model = FilterableItem
          fields = ['text', 'decimal', 'date']
  
  
  class FilterClassRootView(generics.ListCreateAPIView):
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 Make filtering optional, and pluggable. 
rest_framework/tests/filterset.py