Ticket #10180: django-inlineformset-save-new.diff
File django-inlineformset-save-new.diff, 688 bytes (added by , 16 years ago) |
---|
-
django/forms/models.py
493 493 fk_attname = self.fk.get_attname() 494 494 kwargs = {fk_attname: self.instance.pk} 495 495 new_obj = self.model(**kwargs) 496 exclude = [self.fk.name, fk_attname] 496 497 if fk_attname == self._pk_field.attname: 497 exclude = [self._pk_field.name] 498 else: 499 exclude = [] 498 exclude.append(self._pk_field.name) 500 499 return save_instance(form, new_obj, exclude=exclude, commit=commit) 501 500 502 501 def add_fields(self, form, index):