Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Thanks gregcorey@ for the suggestion.

Backport of 660c30e from master
  • Loading branch information...
commit 5567dc68e6fc7788cd9451e5fea52396ffaf3675 1 parent f551d5a
Tim Graham authored

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
@@ -323,7 +323,7 @@ happen when the user changes these values::
323 323
 
324 324
 Default: ``False``
325 325
 
326  
-Lets you create a formset with the ability to delete::
  326
+Lets you create a formset with the ability to select forms for deletion::
327 327
 
328 328
     >>> ArticleFormSet = formset_factory(ArticleForm, can_delete=True)
329 329
     >>> formset = ArticleFormSet(initial=[
@@ -369,6 +369,13 @@ delete fields you can access them with ``deleted_forms``::
369 369
     >>> [form.cleaned_data for form in formset.deleted_forms]
370 370
     [{'DELETE': True, 'pub_date': datetime.date(2008, 5, 10), 'title': u'Article #1'}]
371 371
 
  372
+If you are using a :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`,
  373
+model instances for deleted forms will be deleted when you call
  374
+``formset.save()``. On the other hand, if you are using a plain ``FormSet``,
  375
+it's up to you to handle ``formset.deleted_forms``, perhaps in your formset's
  376
+``save()`` method, as there's no general notion of what it means to delete a
  377
+form.
  378
+
372 379
 Adding additional fields to a formset
373 380
 -------------------------------------
374 381
 
@@ -460,8 +467,8 @@ If you manually render fields in the template, you can render
460 467
     </form>
461 468
 
462 469
 
463  
-Similarly, if the formset has the ability to order (``can_order=True``), it is possible to render it
464  
-with ``{{ form.ORDER }}``.
  470
+Similarly, if the formset has the ability to order (``can_order=True``), it is
  471
+possible to render it with ``{{ form.ORDER }}``.
465 472
 
466 473
 Using more than one formset in a view
467 474
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 notes on commit 5567dc6

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