mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Merge 7db308a823
into fd72a814f8
This commit is contained in:
commit
3be6e3e4f6
|
@ -30,7 +30,11 @@ def get_view_name(view_cls, suffix=None):
|
||||||
|
|
||||||
This function is the default for the `VIEW_NAME_FUNCTION` setting.
|
This function is the default for the `VIEW_NAME_FUNCTION` setting.
|
||||||
"""
|
"""
|
||||||
name = view_cls.__name__
|
try:
|
||||||
|
view = view_cls()
|
||||||
|
name = view.get_view_name()
|
||||||
|
except:
|
||||||
|
name = view_cls.__name__
|
||||||
name = formatting.remove_trailing_string(name, 'View')
|
name = formatting.remove_trailing_string(name, 'View')
|
||||||
name = formatting.remove_trailing_string(name, 'ViewSet')
|
name = formatting.remove_trailing_string(name, 'ViewSet')
|
||||||
name = formatting.camelcase_to_spaces(name)
|
name = formatting.camelcase_to_spaces(name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user