Ticket #16126: 16126_formset_delete_order_links.patch
File 16126_formset_delete_order_links.patch, 1.7 KB (added by , 13 years ago) |
---|
-
docs/topics/forms/formsets.txt
424 424 425 425 The above ends up calling the ``as_table`` method on the formset class. 426 426 427 .. _manually-rendered-can-delete-and-can-order: 428 429 Manually rendered ``can_delete`` and ``can_order`` 430 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 431 432 If you manually render fields in the template, you can render 433 ``can_delete`` parameter with ``{{ form.DELETE }}``: 434 435 .. code-block:: html+django 436 437 <form method="post" action=""> 438 {{ formset.management_form }} 439 {% for form in formset %} 440 {{ form.id }} 441 <ul> 442 <li>{{ form.title }}</li> 443 {% if formset.can_delete %} 444 <li>{{ form.DELETE }}</li> 445 {% enif %} 446 </ul> 447 {% endfor %} 448 </form> 449 450 451 Similarly, if the formset has the ability to order (``can_order=True``), it is possible to render it 452 with ``{{ form.ORDER }}``. 453 427 454 Using more than one formset in a view 428 455 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 429 456 -
docs/topics/forms/modelforms.txt
829 829 ``inlineformset_factory`` uses ``modelformset_factory`` and marks 830 830 ``can_delete=True``. 831 831 832 .. seealso:: 833 834 :ref:`Manually rendered can_delete and can_order <manually-rendered-can-delete-and-can-order>`. 835 832 836 More than one foreign key to the same model 833 837 ------------------------------------------- 834 838