This commit is contained in:
Omer Katz 2017-04-15 22:51:27 +00:00 committed by GitHub
commit 3be6e3e4f6

View File

@ -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)