diff --git a/django/newforms/models.py b/django/newforms/models.py
index e515071..1c10d20 100644
a
|
b
|
class BaseModelFormSet(BaseFormSet):
|
330 | 330 | """Saves model instances for every form, adding and changing instances |
331 | 331 | as necessary, and returns the list of instances. |
332 | 332 | """ |
| 333 | if not commit: |
| 334 | self.saved_forms = [] |
| 335 | def save_m2m(self): |
| 336 | for form in self.saved_forms: |
| 337 | form.save_m2m() |
| 338 | self.save_m2m = save_m2m |
333 | 339 | return self.save_existing_objects(commit) + self.save_new_objects(commit) |
334 | 340 | |
335 | 341 | def save_existing_objects(self, commit=True): |
… |
… |
class BaseModelFormSet(BaseFormSet):
|
352 | 358 | if form.changed_data: |
353 | 359 | self.changed_objects.append((obj, form.changed_data)) |
354 | 360 | saved_instances.append(self.save_existing(form, obj, commit=commit)) |
| 361 | if not commit: |
| 362 | self.saved_forms.append(form) |
355 | 363 | return saved_instances |
356 | 364 | |
357 | 365 | def save_new_objects(self, commit=True): |
… |
… |
class BaseModelFormSet(BaseFormSet):
|
364 | 372 | if self.can_delete and form.cleaned_data[DELETION_FIELD_NAME]: |
365 | 373 | continue |
366 | 374 | self.new_objects.append(self.save_new(form, commit=commit)) |
| 375 | if not commit: |
| 376 | self.saved_forms.append(form) |
367 | 377 | return self.new_objects |
368 | 378 | |
369 | 379 | def add_fields(self, form, index): |