diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-03-19 23:41:59 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-03-19 23:41:59 +0000 |
| commit | 33c4e307f24e4af52430550fd9e444d9add13201 (patch) | |
| tree | ee5ef3e9b4992f4e02d8ad648845d76355f9c972 | |
| parent | 426e7223fb7bf1639a3b331ed3818922fafe820c (diff) | |
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
| -rw-r--r-- | django/core/meta/__init__.py | 5 |
1 files 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." |
