aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorTom Christie2012-10-09 09:57:08 +0100
committerTom Christie2012-10-09 09:57:08 +0100
commitbeea6487b214a0e40e0688a511cce5e065568632 (patch)
treee80d8f33cbd5a530109f1c1a0b91a0286346896e /rest_framework/views.py
parent65f592866c5cd5103e99ed453543807bcbdaa9da (diff)
downloaddjango-rest-framework-beea6487b214a0e40e0688a511cce5e065568632.tar.bz2
Function based views get proper naming in browseable API
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index 790c76fa..2c940dac 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -50,7 +50,8 @@ def _camelcase_to_spaces(content):
Used when generating names from view classes.
"""
camelcase_boundry = '(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))'
- return re.sub(camelcase_boundry, ' \\1', content).strip()
+ content = re.sub(camelcase_boundry, ' \\1', content).strip()
+ return ' '.join(content.split('_')).title()
class APIView(View):