Skip to content

Commit 3cef18c

Browse files
Fixed #1884 -- Made django.db.models.options.get_verbose_name smarter. Thanks, Alex Dedul
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2909 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 34b798c commit 3cef18c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ answer newbie questions, and generally made Django that much better:
5151
Matt Croydon <http://www.postneo.com/>
5252
Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/>
5353
Jason Davies (Esaj) <http://www.jasondavies.com/>
54+
Alex Dedul
5455
5556
Jeremy Dunck <http://dunck.us/>
5657
Clint Ecker

django/db/models/options.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import re
1010

1111
# Calculate the verbose_name by converting from InitialCaps to "lowercase with spaces".
12-
get_verbose_name = lambda class_name: re.sub('([A-Z])', ' \\1', class_name).lower().strip()
12+
get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1', class_name).lower().strip()
1313

1414
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
1515
'unique_together', 'permissions', 'get_latest_by',

0 commit comments

Comments
 (0)