Opened 13 years ago

Closed 13 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: dev
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@…> 13 years ago.
rendering manually can_delete parameter in template
16126_formset_delete_order.patch (1.1 KB ) - added by Aleksandra Sendecka <asendecka@…> 13 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@…> 13 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 by Aymeric Augustin, 13 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

comment:2 by Aleksandra Sendecka <asendecka@…>, 13 years ago

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

by Aleksandra Sendecka <asendecka@…>, 13 years ago

rendering manually can_delete parameter in template

comment:3 by anonymous, 13 years ago

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 by rasca, 13 years ago

Oups, that was me :)

by Aleksandra Sendecka <asendecka@…>, 13 years ago

patch with "if" and with information about can_order

comment:5 by rasca, 13 years ago

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 by Aleksandra Sendecka <asendecka@…>, 13 years ago

by Aleksandra Sendecka <asendecka@…>, 13 years ago

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

comment:7 by Tomek Paczkowski, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Tomek Paczkowski, 13 years ago

Keywords: dceu2011 added

comment:9 by Jannis Leidel, 13 years ago

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