mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Add make_typical_path method.
This commit is contained in:
parent
3c163324ef
commit
f6d04e651a
|
@ -336,6 +336,15 @@ class SchemaGenerator(object):
|
|||
# Methods used when we generate a view instance from the raw callback...
|
||||
|
||||
|
||||
def make_typical_path(self, path):
|
||||
"""
|
||||
Removes '/' from path and returns a linked value using '-'.
|
||||
"""
|
||||
ret = [ partial for partial in path.split('/')
|
||||
if partial and '{' not in partial ]
|
||||
return '-'.join(ret)
|
||||
|
||||
|
||||
def create_view(self, callback, method, request=None):
|
||||
"""
|
||||
Given a callback, return an actual view instance.
|
||||
|
|
Loading…
Reference in New Issue
Block a user