Fixed inconsistent spacing in core/meta/fields.py

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-12-09 02:15:54 +00:00
parent cecd295187
commit 9e2b463baf
1 changed files with 3 additions and 3 deletions

View File

@ -327,7 +327,7 @@ class Field(object):
else: else:
return self.get_default() return self.get_default()
def flatten_data(self, follow, obj = None): def flatten_data(self, follow, obj=None):
""" """
Returns a dictionary mapping the field's manipulator field names to its Returns a dictionary mapping the field's manipulator field names to its
"flattened" string values for the admin view. obj is the instance to "flattened" string values for the admin view. obj is the instance to
@ -724,7 +724,7 @@ class ForeignKey(Field):
else: else:
return self.rel.get_related_field().get_db_prep_save(value) return self.rel.get_related_field().get_db_prep_save(value)
def flatten_data(self, follow, obj = None): def flatten_data(self, follow, obj=None):
if not obj: if not obj:
# In required many-to-one fields with only one available choice, # In required many-to-one fields with only one available choice,
# select that one available choice. Note: We have to check that # select that one available choice. Note: We have to check that
@ -733,7 +733,7 @@ class ForeignKey(Field):
if not self.blank and not self.rel.raw_id_admin and self.choices: if not self.blank and not self.rel.raw_id_admin and self.choices:
choice_list = self.get_choices_default() choice_list = self.get_choices_default()
if len(choice_list) == 2: if len(choice_list) == 2:
return { self.attname : choice_list[1][0] } return {self.attname: choice_list[1][0]}
return Field.flatten_data(self, follow, obj) return Field.flatten_data(self, follow, obj)
class ManyToManyField(Field): class ManyToManyField(Field):