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: | 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>
Attachments (3)
Change History (12)
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
UI/UX: | unset |
by , 13 years ago
Attachment: | 16126_formset_can_delete.patch added |
---|
comment:3 by , 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
by , 13 years ago
Attachment: | 16126_formset_delete_order.patch added |
---|
patch with "if" and with information about can_order
comment:5 by , 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 , 13 years ago
There is one more place where it fits well:
https://docs.djangoproject.com/en/dev/topics/forms/formsets/#using-a-formset-in-views-and-templates
by , 13 years ago
Attachment: | 16126_formset_delete_order_links.patch added |
---|
changes moved to formset to "Using a formset in views and templates" section. Link from previous location added in "See also"
comment:7 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 13 years ago
Keywords: | dceu2011 added |
---|
rendering manually can_delete parameter in template