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:
Adrian Holovaty 2005-12-19 03:28:01 +00:00
parent 743b02825e
commit 3a2c18ac53
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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