mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
Meaningless function removal (associated with subpath)
This commit is contained in:
parent
0fdaf4f481
commit
4a4cd24cab
|
@ -83,18 +83,6 @@ def field_to_schema(field):
|
||||||
return coreschema.String(title=title, description=description)
|
return coreschema.String(title=title, description=description)
|
||||||
|
|
||||||
|
|
||||||
def common_path(paths):
|
|
||||||
split_paths = [path.strip('/').split('/') for path in paths]
|
|
||||||
s1 = min(split_paths)
|
|
||||||
s2 = max(split_paths)
|
|
||||||
common = s1
|
|
||||||
for i, c in enumerate(s1):
|
|
||||||
if c != s2[i]:
|
|
||||||
common = s1[:i]
|
|
||||||
break
|
|
||||||
return '/' + '/'.join(common)
|
|
||||||
|
|
||||||
|
|
||||||
def get_pk_name(model):
|
def get_pk_name(model):
|
||||||
meta = model._meta.concrete_model._meta
|
meta = model._meta.concrete_model._meta
|
||||||
return _get_pk(meta).name
|
return _get_pk(meta).name
|
||||||
|
|
Loading…
Reference in New Issue
Block a user