mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Lint
This commit is contained in:
parent
3d0292e1cd
commit
332c30afb9
|
@ -9,11 +9,8 @@ def get_breadcrumbs(url, request=None):
|
||||||
tuple of (name, url).
|
tuple of (name, url).
|
||||||
"""
|
"""
|
||||||
from rest_framework.reverse import preserve_builtin_query_params
|
from rest_framework.reverse import preserve_builtin_query_params
|
||||||
from rest_framework.settings import api_settings
|
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
view_name_func = api_settings.VIEW_NAME_FUNCTION
|
|
||||||
|
|
||||||
def breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen):
|
def breadcrumbs_recursive(url, breadcrumbs_list, prefix, seen):
|
||||||
"""
|
"""
|
||||||
Add tuples of (name, url) to the breadcrumbs list,
|
Add tuples of (name, url) to the breadcrumbs list,
|
||||||
|
|
|
@ -31,6 +31,7 @@ class NestedResourceRoot(APIView):
|
||||||
class NestedResourceInstance(APIView):
|
class NestedResourceInstance(APIView):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class CustomNameResourceInstance(APIView):
|
class CustomNameResourceInstance(APIView):
|
||||||
def get_view_name(self):
|
def get_view_name(self):
|
||||||
return "Foo"
|
return "Foo"
|
||||||
|
@ -89,7 +90,7 @@ class BreadcrumbTests(TestCase):
|
||||||
('Resource Root', '/resource/'),
|
('Resource Root', '/resource/'),
|
||||||
('Foo', '/resource/customname')
|
('Foo', '/resource/customname')
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_nested_resource_breadcrumbs(self):
|
def test_nested_resource_breadcrumbs(self):
|
||||||
url = '/resource/123/'
|
url = '/resource/123/'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user