mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Adjust comments
This commit is contained in:
parent
ef9e5f20c8
commit
96c39e5c82
|
@ -368,9 +368,7 @@ class AutoSchema(ViewInspector):
|
||||||
else:
|
else:
|
||||||
sections[current_section] += '\n' + line
|
sections[current_section] += '\n' + line
|
||||||
|
|
||||||
# TODO: coerce_method_names is used both here and by SchemaGenerator in
|
# TODO: SCHEMA_COERCE_METHOD_NAMES appears here and in `SchemaGenerator.get_keys`
|
||||||
# get_keys. It is read straight from the setting (i.e. it's not dynamic.)
|
|
||||||
# ???: Can it be a module level constant (or callable)?
|
|
||||||
coerce_method_names = api_settings.SCHEMA_COERCE_METHOD_NAMES
|
coerce_method_names = api_settings.SCHEMA_COERCE_METHOD_NAMES
|
||||||
header = getattr(view, 'action', method.lower())
|
header = getattr(view, 'action', method.lower())
|
||||||
if header in sections:
|
if header in sections:
|
||||||
|
@ -518,11 +516,14 @@ class AutoSchema(ViewInspector):
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# TODO: Where should this live?
|
# Note: With `AutoSchema` defined we attach it to APIView.
|
||||||
# - We import APIView here. So we can't import the descriptor into `views`
|
# * We do this here to avoid the dependency cycle from SchemaView needing
|
||||||
# - APIView is only used by SchemaView.
|
# APIView (below).
|
||||||
# - ???: Make `schemas` a package and move SchemaView to `schema.views`
|
# * This requires importing _something_ from `rest_framework.schemas` or
|
||||||
# - That way the schema attribute could be set in the class definition.
|
# `rest_framework.documentation` before `APIView.schema will be available.
|
||||||
|
# * ???: When would `APIView.schema` be needed and that NOT be the case?
|
||||||
|
# * The alternative is to import AutoSchema to `views`, make `schemas` a
|
||||||
|
# package, and move SchemaView to `schema.views`, importing APIView there.
|
||||||
APIView.schema = AutoSchema()
|
APIView.schema = AutoSchema()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user