views.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:sdining 作者: Lurance 项目源码 文件源码
def get_view_name(view_cls, suffix=None):
    """
    Given a view class, return a textual name to represent the view.
    This name is used in the browsable API, and in OPTIONS responses.

    This function is the default for the `VIEW_NAME_FUNCTION` setting.
    """
    name = view_cls.__name__
    name = formatting.remove_trailing_string(name, 'View')
    name = formatting.remove_trailing_string(name, 'ViewSet')
    name = formatting.camelcase_to_spaces(name)
    if suffix:
        name += ' ' + suffix

    return name
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号