Ticket #9061: t9061-a.diff
File t9061-a.diff, 1.3 KB (added by , 16 years ago) |
---|
-
django/forms/formsets.py
242 242 form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), initial=index+1, required=False) 243 243 else: 244 244 form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), required=False) 245 if self.can_delete :245 if self.can_delete and index < self._initial_form_count: 246 246 form.fields[DELETION_FIELD_NAME] = BooleanField(label=_(u'Delete'), required=False) 247 247 248 248 def add_prefix(self, index): -
django/forms/models.py
400 400 for form in self.extra_forms: 401 401 if not form.has_changed(): 402 402 continue 403 # If someone has marked an add form for deletion, don't save the404 # object.405 if self.can_delete and form.cleaned_data[DELETION_FIELD_NAME]:406 continue407 403 self.new_objects.append(self.save_new(form, commit=commit)) 408 404 if not commit: 409 405 self.saved_forms.append(form)