#17438: Model names wrong in administrator pages
------------------------------+--------------------
     Reporter:  pszabady@…    |      Owner:  nobody
         Type:  Bug           |     Status:  new
    Component:  Core (Other)  |    Version:  1.3
     Severity:  Normal        |   Keywords:
 Triage Stage:  Unreviewed    |  Has patch:  0
Easy pickings:  1             |      UI/UX:  0
------------------------------+--------------------
 If the model name is SERVER_CONFIG then "Server r_config" will be
 displayed in the admin interface.

 Bad line: django\db\models\options.py(20): get_verbose_name = lambda
 class_name: re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1',
 class_name).lower().strip()

 Reproduce in python prompt:

 >>> import re
 >>> e =  re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1',
 "server_config").lower().strip()
 >>> print e
 server_config
 >>> e =  re.sub('(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))', ' \\1',
 "SERVER_CONFIG").lower().strip()
 >>> print e
 serve r_config

 Fix:

 get_verbose_name = lambda class_name: class_name.lower().replace("_"," ")

 Best regards,

 Peter Szabady

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17438>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to