Commit 3cef18cb authored by Adrian Holovaty's avatar Adrian Holovaty
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
parent 34b798cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ from bisect import bisect
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',