Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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
  • Loading branch information...
commit 3cef18cb51204c75bb4eefa4d309c7d6ec065f74 1 parent 34b798c
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 1 deletion.
  1. +1 −0  AUTHORS
  2. +1 −1  django/db/models/options.py
View
1  AUTHORS
@@ -51,6 +51,7 @@ answer newbie questions, and generally made Django that much better:
Matt Croydon <http://www.postneo.com/>
Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/>
Jason Davies (Esaj) <http://www.jasondavies.com/>
+ Alex Dedul
deric@monowerks.com
Jeremy Dunck <http://dunck.us/>
Clint Ecker
View
2  django/db/models/options.py
@@ -9,7 +9,7 @@
import re
# Calculate the verbose_name by converting from InitialCaps to "lowercase with spaces".
-get_verbose_name = lambda class_name: re.sub('([A-Z])', ' \\1', class_name).lower().strip()
+get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1', class_name).lower().strip()
DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
'unique_together', 'permissions', 'get_latest_by',
Please sign in to comment.
Something went wrong with that request. Please try again.