mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Modify action check feature
This commit is contained in:
parent
309c138b33
commit
9b88ea7da7
|
@ -328,7 +328,7 @@ class SchemaGenerator(object):
|
||||||
continue
|
continue
|
||||||
link = self.get_link(path, method, view)
|
link = self.get_link(path, method, view)
|
||||||
typical_path = self.make_typical_path(path)
|
typical_path = self.make_typical_path(path)
|
||||||
keys = self.get_keys(typical_path, method, view)
|
keys = self.get_keys(path, typical_path, method, view)
|
||||||
insert_into(links, keys, link)
|
insert_into(links, keys, link)
|
||||||
return links
|
return links
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ class SchemaGenerator(object):
|
||||||
|
|
||||||
# Method for generating the link layout....
|
# Method for generating the link layout....
|
||||||
|
|
||||||
def get_keys(self, subpath, method, view):
|
def get_keys(self, path, subpath, method, view):
|
||||||
"""
|
"""
|
||||||
Return a list of keys that should be used to layout a link within
|
Return a list of keys that should be used to layout a link within
|
||||||
the schema document.
|
the schema document.
|
||||||
|
@ -607,7 +607,7 @@ class SchemaGenerator(object):
|
||||||
action = view.action
|
action = view.action
|
||||||
else:
|
else:
|
||||||
# Views have no associated action, so we determine one from the method.
|
# Views have no associated action, so we determine one from the method.
|
||||||
if is_list_view(subpath, method, view):
|
if is_list_view(path, method, view):
|
||||||
action = 'list'
|
action = 'list'
|
||||||
else:
|
else:
|
||||||
action = self.default_mapping[method.lower()]
|
action = self.default_mapping[method.lower()]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user