From ff46f0fbcf601be73a7f0866986aa96abac79e8e Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 13 Feb 2007 06:27:28 +0000 Subject: [PATCH] Fixed #3394 -- Made min_num_in_admin be respected on new object creation. Patch from torne-django@wolfpuppy.org.uk. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4500 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 3 ++- django/db/models/related.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 879110e776..5cbfd0a0e1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -98,6 +98,7 @@ answer newbie questions, and generally made Django that much better: Kieran Holland Robert Rock Howard Jason Huggins + Tom Insam Baurzhan Ismagulov jcrasta@gmail.com Michael Josephson @@ -168,8 +169,8 @@ answer newbie questions, and generally made Django that much better: Aaron Swartz Tyson Tate Tom Tobin - Tom Insam Joe Topjian + torne-django@wolfpuppy.org.uk Karen Tracey Makoto Tsuyuki Amit Upadhyay diff --git a/django/db/models/related.py b/django/db/models/related.py index ac1ec50ca2..b76da34079 100644 --- a/django/db/models/related.py +++ b/django/db/models/related.py @@ -68,7 +68,10 @@ class RelatedObject(object): # object return [attr] else: - return [None] * self.field.rel.num_in_admin + if self.field.rel.min_num_in_admin: + return [None] * max(self.field.rel.num_in_admin, self.field.rel.min_num_in_admin) + else: + return [None] * self.field.rel.num_in_admin def get_db_prep_lookup(self, lookup_type, value): # Defer to the actual field definition for db prep