Code

Ticket #9027: mf_f-can-delete.diff

File mf_f-can-delete.diff, 626 bytes (added by gsf, 6 years ago)

modelformset_factory can_delete patch

Line 
1Index: django/forms/models.py
2===================================================================
3--- django/forms/models.py      (revision 9004)
4+++ django/forms/models.py      (working copy)
5@@ -419,7 +419,7 @@
6 
7 def modelformset_factory(model, form=ModelForm, formfield_callback=lambda f: f.formfield(),
8                          formset=BaseModelFormSet,
9-                         extra=1, can_delete=False, can_order=False,
10+                         extra=1, can_delete=True, can_order=False,
11                          max_num=0, fields=None, exclude=None):
12     """
13     Returns a FormSet class for the given Django model class.