mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 18:08:03 +03:00 
			
		
		
		
	Chore: remove all code in filters.py that causes DRF317Warning
This commit is contained in:
		
							parent
							
								
									265c8a98a2
								
							
						
					
					
						commit
						39a258bfab
					
				| 
						 | 
				
			
			@ -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 [
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -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 [
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user