Fixed #8011 -- Be careful not to evalute lazy-translated Meta.verbose_name

values whilst importing models.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-07-29 05:17:47 +00:00
parent b3b71a0922
commit af7773f280
1 changed files with 2 additions and 1 deletions

View File

@ -114,7 +114,8 @@ class RelatedField(object):
def set_attributes_from_rel(self):
self.name = self.name or (self.rel.to._meta.object_name.lower() + '_' + self.rel.to._meta.pk.name)
self.verbose_name = self.verbose_name or self.rel.to._meta.verbose_name
if self.verbose_name is None:
self.verbose_name = self.rel.to._meta.verbose_name
self.rel.field_name = self.rel.field_name or self.rel.to._meta.pk.name
def do_related_class(self, other, cls):