Ticket #9122: generic_inline.diff

File generic_inline.diff, 898 bytes (added by Daniel Roseman, 16 years ago)
  • django/contrib/contenttypes/generic.py

     
    345345        raise Exception("fk_name '%s' is not a ForeignKey to ContentType" % ct_field)
    346346    fk_field = opts.get_field(fk_field) # let the exception propagate
    347347    if exclude is not None:
     348        exclude = list(exclude) # make sure we have list not tuple
    348349        exclude.extend([ct_field.name, fk_field.name])
    349350    else:
    350351        exclude = [ct_field.name, fk_field.name]
     
    377378            "can_delete": True,
    378379            "can_order": False,
    379380            "fields": fields,
     381            "max_num": self.max_num,
     382            "exclude": self.exclude
    380383        }
    381384        return generic_inlineformset_factory(self.model, **defaults)
    382385
Back to Top