Opened 5 years ago

Closed 5 years ago

#16126 closed Cleanup/optimization (fixed)

please add information on rendering DELETE checkbox manually for formset

Reported by: tim@… Owned by: Aleksandra Sendecka
Component: Documentation Version: master
Severity: Normal Keywords: dceu2011
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-the-formset-in-the-template

<form method="post" action="">
    {{ formset.management_form }}
    {% for form in formset %}
        {{ form.id }}
        <ul>
            <li>{{ form.name }}</li>
            <li>{{ form.age }}</li>
            <li>{{ form.DELETE }}</li>   <!--  ** Something like this ** -->
        </ul>
    {% endfor %}
</form>

http://stackoverflow.com/questions/2635410/

Attachments (3)

16126_formset_can_delete.patch (899 bytes) - added by Aleksandra Sendecka <asendecka@…> 5 years ago.
rendering manually can_delete parameter in template
16126_formset_delete_order.patch (1.1 KB) - added by Aleksandra Sendecka <asendecka@…> 5 years ago.
patch with "if" and with information about can_order
16126_formset_delete_order_links.patch (1.7 KB) - added by Aleksandra Sendecka <asendecka@…> 5 years ago.
changes moved to formset to "Using a formset in views and templates" section. Link from previous location added in "See also"

Download all attachments as: .zip

Change History (12)

comment:1 Changed 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 Changed 5 years ago by Aleksandra Sendecka <asendecka@…>

Owner: changed from nobody to Aleksandra Sendecka
UI/UX: unset

Changed 5 years ago by Aleksandra Sendecka <asendecka@…>

rendering manually can_delete parameter in template

comment:3 Changed 5 years ago by anonymous

I would also add a check for can_delete something like

{% if formset.can_delete %}
    {{ form.DELETE }}
{% endif %}

And maybe, if it isn't out of scope add the same docs for can_order and form.ORDER

comment:4 Changed 5 years ago by rasca

Oups, that was me :)

Changed 5 years ago by Aleksandra Sendecka <asendecka@…>

patch with "if" and with information about can_order

comment:5 Changed 5 years ago by rasca

Checking in more detail, I think this should be in https://docs.djangoproject.com/en/dev/topics/forms/formsets/#can-order and in https://docs.djangoproject.com/en/dev/topics/forms/formsets/#can-delete . And maybe and example in each?

And in https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets can_delete can link to formsets/#can-delete.

What do you think?

comment:6 Changed 5 years ago by Aleksandra Sendecka <asendecka@…>

Changed 5 years ago by Aleksandra Sendecka <asendecka@…>

changes moved to formset to "Using a formset in views and templates" section. Link from previous location added in "See also"

comment:7 Changed 5 years ago by Tomek Paczkowski

Triage Stage: AcceptedReady for checkin

comment:8 Changed 5 years ago by Tomek Paczkowski

Keywords: dceu2011 added

comment:9 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

In [16430]:

Fixed #16126 -- Added documentation about DELETE and ORDER fields in formsets. Many thanks to Aleksandra Sendecka.

Note: See TracTickets for help on using tickets.
Back to Top