mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
magic-removal: Small code cleanup
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
743b02825e
commit
3a2c18ac53
@ -76,8 +76,7 @@ class ForeignKey(SharedMethods, Field):
|
||||
try:
|
||||
to_name = to._meta.object_name.lower()
|
||||
except AttributeError: # to._meta doesn't exist, so it must be RECURSIVE_RELATIONSHIP_CONSTANT
|
||||
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)
|
||||
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)
|
||||
kwargs['verbose_name'] = kwargs.get('verbose_name', '')
|
||||
else:
|
||||
to_field = to_field or to._meta.pk.name
|
||||
|
Loading…
x
Reference in New Issue
Block a user