mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
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
1 changed files with 4 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue