Fixed behaviour of admin interface (and AddManipulator) when
min/max_num_in_admin is specified without num_in_admin. A consequence of changes in [4500]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4542 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fb509ee8d3
commit
babc0793e3
|
@ -104,12 +104,12 @@ class RelatedObject(object):
|
|||
attr = getattr(manipulator.original_object, self.get_accessor_name())
|
||||
count = attr.count()
|
||||
count += self.field.rel.num_extra_on_change
|
||||
if self.field.rel.min_num_in_admin:
|
||||
count = max(count, self.field.rel.min_num_in_admin)
|
||||
if self.field.rel.max_num_in_admin:
|
||||
count = min(count, self.field.rel.max_num_in_admin)
|
||||
else:
|
||||
count = self.field.rel.num_in_admin
|
||||
if self.field.rel.min_num_in_admin:
|
||||
count = max(count, self.field.rel.min_num_in_admin)
|
||||
if self.field.rel.max_num_in_admin:
|
||||
count = min(count, self.field.rel.max_num_in_admin)
|
||||
else:
|
||||
count = 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue