Django

Code

Changeset 2909

Show
Ignore:
Timestamp:
05/15/06 13:50:54 (2 years ago)
Author:
adrian
Message:

Fixed #1884 -- Made django.db.models.options.get_verbose_name smarter. Thanks, Alex Dedul

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r2906 r2909  
    5252    Jonathan Daugherty (cygnus) <http://www.cprogrammer.org/> 
    5353    Jason Davies (Esaj) <http://www.jasondavies.com/> 
     54    Alex Dedul 
    5455    deric@monowerks.com 
    5556    Jeremy Dunck <http://dunck.us/> 
  • django/trunk/django/db/models/options.py

    r2870 r2909  
    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() 
     12get_verbose_name = lambda class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1', class_name).lower().strip() 
    1313 
    1414DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',