1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #6217 -- Reduced the memory used by each ugettext_lazy() call.

Thanks to Jakub Wilk for analysis and the initial patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2008-07-27 22:51:49 +00:00
parent 7d1c147bb4
commit 6a287ed946
3 changed files with 35 additions and 24 deletions

View File

@@ -191,7 +191,8 @@ class Field(object):
def set_attributes_from_name(self, name):
self.name = name
self.attname, self.column = self.get_attname_column()
self.verbose_name = self.verbose_name or (name and name.replace('_', ' '))
if self.verbose_name is None and name:
self.verbose_name = name.replace('_', ' ')
def contribute_to_class(self, cls, name):
self.set_attributes_from_name(name)