Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.6.x] Fixed #16965 -- Clarified Formset can_delete docs.

Thanks gregcorey@ for the suggestion.

Backport of 660c30e from master
  • Loading branch information...
commit 730069197fd29d7b055a260a1344802b16415fb4 1 parent 67a6b5e
Tim Graham authored July 08, 2013

Showing 1 changed file with 10 additions and 3 deletions. Show diff stats Hide diff stats

  1. 13  docs/topics/forms/formsets.txt
13  docs/topics/forms/formsets.txt
@@ -413,7 +413,7 @@ happen when the user changes these values::
413 413
 
414 414
 Default: ``False``
415 415
 
416  
-Lets you create a formset with the ability to delete::
  416
+Lets you create a formset with the ability to select forms for deletion::
417 417
 
418 418
     >>> from django.forms.formsets import formset_factory
419 419
     >>> from myapp.forms import ArticleForm
@@ -461,6 +461,13 @@ delete fields you can access them with ``deleted_forms``::
461 461
     >>> [form.cleaned_data for form in formset.deleted_forms]
462 462
     [{'DELETE': True, 'pub_date': datetime.date(2008, 5, 10), 'title': u'Article #1'}]
463 463
 
  464
+If you are using a :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`,
  465
+model instances for deleted forms will be deleted when you call
  466
+``formset.save()``. On the other hand, if you are using a plain ``FormSet``,
  467
+it's up to you to handle ``formset.deleted_forms``, perhaps in your formset's
  468
+``save()`` method, as there's no general notion of what it means to delete a
  469
+form.
  470
+
464 471
 Adding additional fields to a formset
465 472
 -------------------------------------
466 473
 
@@ -559,8 +566,8 @@ If you manually render fields in the template, you can render
559 566
     </form>
560 567
 
561 568
 
562  
-Similarly, if the formset has the ability to order (``can_order=True``), it is possible to render it
563  
-with ``{{ form.ORDER }}``.
  569
+Similarly, if the formset has the ability to order (``can_order=True``), it is
  570
+possible to render it with ``{{ form.ORDER }}``.
564 571
 
565 572
 Using more than one formset in a view
566 573
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 notes on commit 7300691

Please sign in to comment.
Something went wrong with that request. Please try again.