Fixed a subtle bug (really, an inconsistency) in ForeignKey that [8132] exposed by causing the model_forms test to fail.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bf777442fa
commit
b69b15fe02
|
@ -624,7 +624,7 @@ class ForeignKey(RelatedField, Field):
|
||||||
assert isinstance(to, basestring), "%s(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)
|
assert isinstance(to, basestring), "%s(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r" % (self.__class__.__name__, to, RECURSIVE_RELATIONSHIP_CONSTANT)
|
||||||
else:
|
else:
|
||||||
to_field = to_field or to._meta.pk.name
|
to_field = to_field or to._meta.pk.name
|
||||||
kwargs['verbose_name'] = kwargs.get('verbose_name', '')
|
kwargs['verbose_name'] = kwargs.get('verbose_name', None)
|
||||||
|
|
||||||
if 'edit_inline_type' in kwargs:
|
if 'edit_inline_type' in kwargs:
|
||||||
import warnings
|
import warnings
|
||||||
|
|
Loading…
Reference in New Issue