mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Updated default view name/description functions
Forgot to update the default view name/description functions to the new setup.
This commit is contained in:
parent
e6662d434f
commit
11d7c1838a
|
@ -56,8 +56,8 @@ def markup_description(description):
|
||||||
return mark_safe(description)
|
return mark_safe(description)
|
||||||
|
|
||||||
|
|
||||||
def view_name(cls, suffix=None):
|
def view_name(instance, view, suffix=None):
|
||||||
name = cls.__name__
|
name = view.__name__
|
||||||
name = _remove_trailing_string(name, 'View')
|
name = _remove_trailing_string(name, 'View')
|
||||||
name = _remove_trailing_string(name, 'ViewSet')
|
name = _remove_trailing_string(name, 'ViewSet')
|
||||||
name = _camelcase_to_spaces(name)
|
name = _camelcase_to_spaces(name)
|
||||||
|
@ -66,8 +66,8 @@ def view_name(cls, suffix=None):
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def view_description(cls, html=False):
|
def view_description(instance, view, html=False):
|
||||||
description = cls.__doc__ or ''
|
description = view.__doc__ or ''
|
||||||
description = _remove_leading_indent(smart_text(description))
|
description = _remove_leading_indent(smart_text(description))
|
||||||
if html:
|
if html:
|
||||||
return markup_description(description)
|
return markup_description(description)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user