Ticket #5759: inline_formset_form_kwarg.diff
File inline_formset_form_kwarg.diff, 1.2 KB (added by , 17 years ago) |
---|
-
django/newforms/models.py
338 338 raise Exception("%s has more than 1 ForeignKey to %s" % (model, parent_model)) 339 339 return fk 340 340 341 def inline_formset(parent_model, model, f k_name=None, fields=None, extra=3, orderable=False, deletable=True, formfield_callback=lambda f: f.formfield()):341 def inline_formset(parent_model, model, form=BaseForm, fk_name=None, fields=None, extra=3, orderable=False, deletable=True, formfield_callback=lambda f: f.formfield()): 342 342 """ 343 343 Returns an ``InlineFormset`` for the given kwargs. 344 344 … … 347 347 """ 348 348 fk = get_foreign_key(parent_model, model, fk_name=fk_name) 349 349 # let the formset handle object deletion by default 350 FormSet = formset_for_model(model, form set=InlineFormset, fields=fields,350 FormSet = formset_for_model(model, form=form, formset=InlineFormset, fields=fields, 351 351 formfield_callback=formfield_callback, 352 352 extra=extra, orderable=orderable, 353 353 deletable=deletable)