Ticket #25039: 25039.diff

File 25039.diff, 679 bytes (added by Grigoriy Kramarenko, 9 years ago)
  • django/db/models/fields/__init__.py

    diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
    index 5ae1aa3..38c063c 100644
    a b class Field(RegisterLookupMixin):  
    658658            self.name = name
    659659        self.attname, self.column = self.get_attname_column()
    660660        self.concrete = self.column is not None
     661        if self.verbose_name is None and self.rel and not isinstance(self.rel.to, six.string_types):
     662            self.verbose_name = self.rel.to._meta.verbose_name
    661663        if self.verbose_name is None and self.name:
    662664            self.verbose_name = self.name.replace('_', ' ')
    663665
Back to Top