From 33c4e307f24e4af52430550fd9e444d9add13201 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 19 Mar 2006 23:41:59 +0000 Subject: [PATCH] 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 --- django/core/meta/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index af4e29167e..b709e56341 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -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."