diff options
| author | Tom Christie | 2012-10-09 09:57:08 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-10-09 09:57:08 +0100 |
| commit | beea6487b214a0e40e0688a511cce5e065568632 (patch) | |
| tree | e80d8f33cbd5a530109f1c1a0b91a0286346896e /rest_framework/views.py | |
| parent | 65f592866c5cd5103e99ed453543807bcbdaa9da (diff) | |
| download | django-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.py | 3 |
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): |
