mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
The default get_view_name method should attempt to get the view's name from the view's instance.
This commit is contained in:
parent
761e66ffdd
commit
d34978de9e
|
@ -22,6 +22,10 @@ def get_view_name(view_cls, suffix=None):
|
|||
|
||||
This function is the default for the `VIEW_NAME_FUNCTION` setting.
|
||||
"""
|
||||
try:
|
||||
view = view_cls()
|
||||
name = view.get_view_name()
|
||||
else:
|
||||
name = view_cls.__name__
|
||||
name = formatting.remove_trailing_string(name, 'View')
|
||||
name = formatting.remove_trailing_string(name, 'ViewSet')
|
||||
|
|
Loading…
Reference in New Issue
Block a user