Ticket #14938: 14938_patch.txt

File 14938_patch.txt, 1.4 KB (added by rax, 13 years ago)

Patch fixing the issue

Line 
1### Eclipse Workspace Patch 1.0
2#P django
3Index: django/forms/models.py
4===================================================================
5--- django/forms/models.py (revision 15024)
6+++ django/forms/models.py (working copy)
7@@ -707,11 +707,18 @@
8 if self.save_as_new:
9 return 0
10 return super(BaseInlineFormSet, self).initial_form_count()
11-
12- def total_form_count(self):
13- if self.save_as_new:
14- return super(BaseInlineFormSet, self).initial_form_count()
15- return super(BaseInlineFormSet, self).total_form_count()
16+
17+# TODO(rax): Remove this method to fix http://code.djangoproject.com/ticket/14938
18+# super(BaseInlineFormSet, self).initial_form_count() when save_as_new
19+# is True is the number of already existing instances which have to be copied.
20+# Here we want the total number. Removing this method fix the issue.
21+# However I have no clue why this method was added. I hope this helps
22+#===============================================================================
23+# def total_form_count(self):
24+# if self.save_as_new:
25+# return super(BaseInlineFormSet, self).initial_form_count()
26+# return super(BaseInlineFormSet, self).total_form_count()
27+#===============================================================================
28
29 def _construct_form(self, i, **kwargs):
30 form = super(BaseInlineFormSet, self)._construct_form(i, **kwargs)
Back to Top