Author: mtredinnick
Date: 2007-02-18 22:18:46 -0600 (Sun, 18 Feb 2007)
New Revision: 4542
Modified:
django/trunk/django/db/models/related.py
Log:
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].
Modified: django/trunk/django/db/models/related.py
===================================================================
--- django/trunk/django/db/models/related.py 2007-02-18 08:07:18 UTC (rev
4541)
+++ django/trunk/django/db/models/related.py 2007-02-19 04:18:46 UTC (rev
4542)
@@ -104,12 +104,12 @@
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---