Simplified two unnecessary list comprehensions in core/meta/__init__.py. Thanks, Ned Batchelder

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-03-19 23:41:59 +00:00
parent 426e7223fb
commit 33c4e307f2
1 changed files with 2 additions and 3 deletions

View File

@ -205,14 +205,13 @@ class RelatedObject(object):
change = count - len(list)
if change > 0:
return list + [None for _ in range(change)]
return list + [None] * len(change)
if change < 0:
return list[:change]
else: # Just right
return list
else:
return [None for _ in range(self.field.rel.num_in_admin)]
return [None] * len(self.field.rel.num_in_admin)
def editable_fields(self):
"Get the fields in this class that should be edited inline."