From 3c163324ef4c604f87b63c4dcef6a52c23fe3685 Mon Sep 17 00:00:00 2001 From: sol HYUN Date: Thu, 23 Mar 2017 17:34:01 +0900 Subject: [PATCH] Meaningless method removal (associated with subpath) --- rest_framework/schemas.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/rest_framework/schemas.py b/rest_framework/schemas.py index 432f09952..27434d337 100644 --- a/rest_framework/schemas.py +++ b/rest_framework/schemas.py @@ -335,36 +335,6 @@ class SchemaGenerator(object): # Methods used when we generate a view instance from the raw callback... - def determine_path_prefix(self, paths): - """ - Given a list of all paths, return the common prefix which should be - discounted when generating a schema structure. - - This will be the longest common string that does not include that last - component of the URL, or the last component before a path parameter. - - For example: - - /api/v1/users/ - /api/v1/users/{pk}/ - - The path prefix is '/api/v1/' - """ - prefixes = [] - for path in paths: - components = path.strip('/').split('/') - initial_components = [] - for component in components: - if '{' in component: - break - initial_components.append(component) - prefix = '/'.join(initial_components[:-1]) - if not prefix: - # We can just break early in the case that there's at least - # one URL that doesn't have a path prefix. - return '/' - prefixes.append('/' + prefix + '/') - return common_path(prefixes) def create_view(self, callback, method, request=None): """