Ticket #3394: min_num_in_admin.diff

File min_num_in_admin.diff, 848 bytes (added by torne-django@…, 18 years ago)
  • django/db/models/related.py

    Mon Jan 29 19:44:48 GMT 2007  Torne <torne@wolfpuppy.org.uk>
      * Correct behaviour of min_num_in_admin on new objects
    diff -rN -u old-dev/django/db/models/related.py new-dev/django/db/models/related.py
    old new  
    6868                # object
    6969                return [attr]
    7070        else:
    71             return [None] * self.field.rel.num_in_admin
     71            if self.field.rel.min_num_in_admin:
     72                return [None] * max(self.field.rel.num_in_admin, self.field.rel.min_num_in_admin)
     73            else:
     74                return [None] * self.field.rel.num_in_admin
    7275
    7376    def get_db_prep_lookup(self, lookup_type, value):
    7477        # Defer to the actual field definition for db prep
Back to Top