* owner: nobody => danielward
* status: new => assigned
Comment:
While I can understand how from a usability perspective this could be
confusing, the ability to delete can also be a useful way to discard a new
form entry rather than having to clear each populated field for the given
form(s).
As a result, I propose adding a `can_delete_extra` option to formsets,
which allow developers to decide whether they wish to omit deletion fields
from their formsets without having to write any any additional logic in to
their templates/views.
I'm about to attach the relevant patches. If accepted, I'm happy to
provide a patch to public documentation for reference also.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "before.patch" added.
Latest 'before' test to confirm behaviour
--
Ticket URL: <https://code.djangoproject.com/ticket/9061>
* Attachment "potential-solution.patch" added.
Potential solution by adding in 'can_delete_extra' option
* Attachment "after.patch" added.
Tests introduced to ensure all is well following introduction of potential
solution
* needs_tests: 1 => 0
Comment:
[https://github.com/django/django/pull/4772 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:10>
* needs_better_patch: 0 => 1
Comment:
Left comments for improvement on the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:11>
Comment (by danielward):
Addressed points raised in PR (4772) and opened new PR (5323) as advised.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:12>
Comment (by timgraham):
Thanks for the updating patch. After you do so, don't forget to uncheck
"Patch needs improvement" so the ticket returns to the review queue. I'll
leave it checked for now as we've hit the feature freeze for 1.9 and the
patch will need to be updated for 1.10 once we cut the stable/1.9.x branch
this week.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:13>
Comment (by danielward):
Thanks Tim, I've updated the version number in the associated
documentation from 1.9 to 1.10 accordingly. I'll update the ticket once
the automated builds have succeeded.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:14>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:15>
* needs_better_patch: 0 => 1
Comment:
The new option should be available on model formsets too.
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:16>
* owner: Daniel Ward => David Smith
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:17>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:18>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:19>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"162765d6c3182e36095d29543e21b44b908625fc" 162765d6]:
{{{
#!CommitTicketReference repository=""
revision="162765d6c3182e36095d29543e21b44b908625fc"
Fixed #9061 -- Allowed FormSets to disable deleting extra forms.
Thanks to Dan Ward for the initial patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:20>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"35b03788b0607c1f8d2b64e4fa9e1669b0907ea4" 35b03788]:
{{{
#!CommitTicketReference repository=""
revision="35b03788b0607c1f8d2b64e4fa9e1669b0907ea4"
Refs #9061 -- Allowed GenericInlineFormSet to disable deleting extra
forms.
Follow up to 162765d6c3182e36095d29543e21b44b908625fc.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/9061#comment:21>