Ticket #1884: get_verbose_name.patch
File get_verbose_name.patch, 611 bytes (added by , 19 years ago) |
---|
-
options.py
9 9 import re 10 10 11 11 # 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() 13 13 14 14 DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering', 15 15 'unique_together', 'permissions', 'get_latest_by',