diff --git a/django/forms/models.py b/django/forms/models.py
index f2d514f..8f6b700 100644
a
|
b
|
from forms import BaseForm, get_declared_fields
|
16 | 16 | from fields import Field, ChoiceField |
17 | 17 | from widgets import SelectMultiple, HiddenInput, MultipleHiddenInput |
18 | 18 | from widgets import media_property |
19 | | from formsets import BaseFormSet, formset_factory, DELETION_FIELD_NAME |
| 19 | from formsets import BaseFormSet, formset_factory |
20 | 20 | |
21 | 21 | __all__ = ( |
22 | 22 | 'ModelForm', 'BaseModelForm', 'model_to_dict', 'fields_for_model', |
… |
… |
class BaseModelFormSet(BaseFormSet):
|
609 | 609 | pk_value = getattr(pk_value, 'pk', pk_value) |
610 | 610 | |
611 | 611 | obj = self._existing_object(pk_value) |
612 | | if self.can_delete: |
613 | | raw_delete_value = form._raw_value(DELETION_FIELD_NAME) |
614 | | should_delete = form.fields[DELETION_FIELD_NAME].clean(raw_delete_value) |
615 | | if should_delete: |
616 | | self.deleted_objects.append(obj) |
617 | | obj.delete() |
618 | | continue |
| 612 | if self.can_delete and self._should_delete_form (form): |
| 613 | self.deleted_objects.append(obj) |
| 614 | obj.delete() |
| 615 | continue |
619 | 616 | if form.has_changed(): |
620 | 617 | self.changed_objects.append((obj, form.changed_data)) |
621 | 618 | saved_instances.append(self.save_existing(form, obj, commit=commit)) |
… |
… |
class BaseModelFormSet(BaseFormSet):
|
630 | 627 | continue |
631 | 628 | # If someone has marked an add form for deletion, don't save the |
632 | 629 | # object. |
633 | | if self.can_delete: |
634 | | raw_delete_value = form._raw_value(DELETION_FIELD_NAME) |
635 | | should_delete = form.fields[DELETION_FIELD_NAME].clean(raw_delete_value) |
636 | | if should_delete: |
637 | | continue |
| 630 | if self.can_delete and self._should_delete_form (form): |
| 631 | continue |
638 | 632 | self.new_objects.append(self.save_new(form, commit=commit)) |
639 | 633 | if not commit: |
640 | 634 | self.saved_forms.append(form) |