From 3a2c18ac53891ccfebb218d6d0b1b873c498b630 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 19 Dec 2005 03:28:01 +0000 Subject: [PATCH] magic-removal: Small code cleanup git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1729 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/fields/related.py | 5 ++--- django/db/models/manipulators.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index f2f0df8f41..24433e0dfe 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -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 @@ -101,7 +100,7 @@ class ForeignKey(SharedMethods, Field): Field.__init__(self, **kwargs) if not self.db_index: - self.db_index = True + self.db_index = True def prepare_field_objs_and_params(self, manipulator, name_prefix): params = {'validator_list': self.validator_list[:]} diff --git a/django/db/models/manipulators.py b/django/db/models/manipulators.py index 7453c84108..46369ea7b5 100644 --- a/django/db/models/manipulators.py +++ b/django/db/models/manipulators.py @@ -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