From 35e058cdb151ed49dd7627bc7e181e905b425e0c Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Wed, 6 Sep 2017 17:42:53 +0200 Subject: [PATCH] Rename to EndpointEnumerator --- rest_framework/schemas/__init__.py | 11 +++++++++++ rest_framework/schemas/generators.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rest_framework/schemas/__init__.py b/rest_framework/schemas/__init__.py index 2e972ceb6..d69925bca 100644 --- a/rest_framework/schemas/__init__.py +++ b/rest_framework/schemas/__init__.py @@ -1,3 +1,14 @@ +# We expose a minimal "public" API directly from `schemas`. This covers the +# basic use-cases: +# +# from rest_framework.schemas import ( +# AutoSchema, +# ManualSchema, +# get_schema_view, +# SchemaGenerator, +# ) +# +# Other access should target the submodules directly from .generators import SchemaGenerator from .inspectors import AutoSchema, ManualSchema # noqa diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index a5778f0f8..eeea9d709 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -79,7 +79,7 @@ def endpoint_ordering(endpoint): return (path, method_priority) -class EndpointInspector(object): +class EndpointEnumerator(object): """ A class to determine the available API endpoints that a project exposes. """ @@ -172,7 +172,7 @@ class SchemaGenerator(object): 'patch': 'partial_update', 'delete': 'destroy', } - endpoint_inspector_cls = EndpointInspector + endpoint_inspector_cls = EndpointEnumerator # Map the method names we use for viewset actions onto external schema names. # These give us names that are more suitable for the external representation.