@@ -48,13 +48,6 @@ def filter_queryset(self, request, queryset, view):
48
48
"""
49
49
raise NotImplementedError (".filter_queryset() must be overridden." )
50
50
51
- def get_schema_fields (self , view ):
52
- assert coreapi is not None , 'coreapi must be installed to use `get_schema_fields()`'
53
- if coreapi is not None :
54
- warnings .warn ('CoreAPI compatibility is deprecated and will be removed in DRF 3.17' , RemovedInDRF317Warning )
55
- assert coreschema is not None , 'coreschema must be installed to use `get_schema_fields()`'
56
- return []
57
-
58
51
def get_schema_operation_parameters (self , view ):
59
52
return []
60
53
@@ -186,23 +179,6 @@ def to_html(self, request, queryset, view):
186
179
template = loader .get_template (self .template )
187
180
return template .render (context )
188
181
189
- def get_schema_fields (self , view ):
190
- assert coreapi is not None , 'coreapi must be installed to use `get_schema_fields()`'
191
- if coreapi is not None :
192
- warnings .warn ('CoreAPI compatibility is deprecated and will be removed in DRF 3.17' , RemovedInDRF317Warning )
193
- assert coreschema is not None , 'coreschema must be installed to use `get_schema_fields()`'
194
- return [
195
- coreapi .Field (
196
- name = self .search_param ,
197
- required = False ,
198
- location = 'query' ,
199
- schema = coreschema .String (
200
- title = force_str (self .search_title ),
201
- description = force_str (self .search_description )
202
- )
203
- )
204
- ]
205
-
206
182
def get_schema_operation_parameters (self , view ):
207
183
return [
208
184
{
@@ -280,9 +256,9 @@ def get_default_valid_fields(self, queryset, view, context={}):
280
256
(field .source .replace ('.' , '__' ) or field_name , field .label )
281
257
for field_name , field in serializer_class (context = context ).fields .items ()
282
258
if (
283
- not getattr (field , 'write_only' , False ) and
284
- not field .source == '*' and
285
- field .source not in model_property_names
259
+ not getattr (field , 'write_only' , False ) and
260
+ not field .source == '*' and
261
+ field .source not in model_property_names
286
262
)
287
263
]
288
264
@@ -348,23 +324,6 @@ def to_html(self, request, queryset, view):
348
324
context = self .get_template_context (request , queryset , view )
349
325
return template .render (context )
350
326
351
- def get_schema_fields (self , view ):
352
- assert coreapi is not None , 'coreapi must be installed to use `get_schema_fields()`'
353
- if coreapi is not None :
354
- warnings .warn ('CoreAPI compatibility is deprecated and will be removed in DRF 3.17' , RemovedInDRF317Warning )
355
- assert coreschema is not None , 'coreschema must be installed to use `get_schema_fields()`'
356
- return [
357
- coreapi .Field (
358
- name = self .ordering_param ,
359
- required = False ,
360
- location = 'query' ,
361
- schema = coreschema .String (
362
- title = force_str (self .ordering_title ),
363
- description = force_str (self .ordering_description )
364
- )
365
- )
366
- ]
367
-
368
327
def get_schema_operation_parameters (self , view ):
369
328
return [
370
329
{
0 commit comments