Ticket #4114: related.patch
File related.patch, 1.2 KB (added by , 18 years ago) |
---|
-
django/db/models/fields/related.py
472 472 assert isinstance(to, basestring), "ForeignKey(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r" % (to, RECURSIVE_RELATIONSHIP_CONSTANT) 473 473 else: 474 474 to_field = to_field or to._meta.pk.name 475 kwargs['verbose_name'] = kwargs.get('verbose_name', '')475 kwargs['verbose_name'] = kwargs.get('verbose_name', to._meta.verbose_name) 476 476 477 477 if kwargs.has_key('edit_inline_type'): 478 478 import warnings … … 565 565 assert isinstance(to, basestring), "OneToOneField(%r) is invalid. First parameter to OneToOneField must be either a model, a model name, or the string %r" % (to, RECURSIVE_RELATIONSHIP_CONSTANT) 566 566 else: 567 567 to_field = to_field or to._meta.pk.name 568 kwargs['verbose_name'] = kwargs.get('verbose_name', '')568 kwargs['verbose_name'] = kwargs.get('verbose_name', to._meta.verbose_name) 569 569 570 570 if kwargs.has_key('edit_inline_type'): 571 571 import warnings