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
|
||||
|
|
|
@ -65,7 +65,7 @@ class AutomaticManipulator(Manipulator):
|
|||
setattr(other_cls, name, ManipulatorDescriptor(name, cls))
|
||||
contribute_to_class = classmethod(contribute_to_class)
|
||||
|
||||
def __init__(self, original_object= None, follow=None):
|
||||
def __init__(self, original_object=None, follow=None):
|
||||
self.follow = self.model._meta.get_follow(follow)
|
||||
self.fields = []
|
||||
self.original_object = original_object
|
||||
|
|
Loading…
Reference in New Issue