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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user