Ticket #16965: 16965.diff

File 16965.diff, 1.6 KB (added by Tim Graham, 11 years ago)
  • docs/topics/forms/formsets.txt

    diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt
    index 29139c5..0d1db8f 100644
    a b happen when the user changes these values::  
    413413
    414414Default: ``False``
    415415
    416 Lets you create a formset with the ability to delete::
     416Lets you create a formset with the ability to select forms for deletion::
    417417
    418418    >>> from django.forms.formsets import formset_factory
    419419    >>> from myapp.forms import ArticleForm
    delete fields you can access them with ``deleted_forms``::  
    461461    >>> [form.cleaned_data for form in formset.deleted_forms]
    462462    [{'DELETE': True, 'pub_date': datetime.date(2008, 5, 10), 'title': u'Article #1'}]
    463463
     464If you are using a :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`,
     465instances for deleted forms will be deleted when you call ``formset.save()``.
     466On the other hand, if you are using a plain ``FormSet``, it's up to you to
     467handle ``formset.deleted_forms``, perhaps in your ``FormSet``'s ``save()``
     468method, as there's no general way of deleting a form.
     469
    464470Adding additional fields to a formset
    465471-------------------------------------
    466472
    If you manually render fields in the template, you can render  
    559565    </form>
    560566
    561567
    562 Similarly, if the formset has the ability to order (``can_order=True``), it is possible to render it
    563 with ``{{ form.ORDER }}``.
     568Similarly, if the formset has the ability to order (``can_order=True``), it is
     569possible to render it with ``{{ form.ORDER }}``.
    564570
    565571Using more than one formset in a view
    566572~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Back to Top