diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 3f4730da8..709225364 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -48,13 +48,6 @@ class BaseFilterBackend: """ raise NotImplementedError(".filter_queryset() must be overridden.") - def get_schema_fields(self, view): - assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`' - if coreapi is not None: - warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning) - assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`' - return [] - def get_schema_operation_parameters(self, view): return [] @@ -186,23 +179,6 @@ class SearchFilter(BaseFilterBackend): template = loader.get_template(self.template) return template.render(context) - def get_schema_fields(self, view): - assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`' - if coreapi is not None: - warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning) - assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`' - return [ - coreapi.Field( - name=self.search_param, - required=False, - location='query', - schema=coreschema.String( - title=force_str(self.search_title), - description=force_str(self.search_description) - ) - ) - ] - def get_schema_operation_parameters(self, view): return [ { @@ -280,9 +256,9 @@ class OrderingFilter(BaseFilterBackend): (field.source.replace('.', '__') or field_name, field.label) for field_name, field in serializer_class(context=context).fields.items() if ( - not getattr(field, 'write_only', False) and - not field.source == '*' and - field.source not in model_property_names + not getattr(field, 'write_only', False) and + not field.source == '*' and + field.source not in model_property_names ) ] @@ -348,23 +324,6 @@ class OrderingFilter(BaseFilterBackend): context = self.get_template_context(request, queryset, view) return template.render(context) - def get_schema_fields(self, view): - assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`' - if coreapi is not None: - warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning) - assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`' - return [ - coreapi.Field( - name=self.ordering_param, - required=False, - location='query', - schema=coreschema.String( - title=force_str(self.ordering_title), - description=force_str(self.ordering_description) - ) - ) - ] - def get_schema_operation_parameters(self, view): return [ {