Re: [Django] #10284: ModelFormSet - objects are deleted even if commit=False

24 views
Skip to first unread message

Django

unread,
Mar 26, 2013, 6:11:51 PM3/26/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by carljm):

* stage: Design decision needed => Accepted


Comment:

I don't understand the rationale jacob gave for rejecting the initial
patch ("related objects will never get deleted by anyone.") Flipping back
to Accepted status; even if the current patch is wrong for some reason I'm
not getting, I think this is still clearly a bug that should be fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 12, 2013, 9:57:39 AM7/12/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by timo):

* cc: timograham@… (added)


Comment:

Updated [https://github.com/django/django/pull/1351 PR]. Seems
straightforward to me.

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:12>

Django

unread,
Jul 12, 2013, 10:30:26 AM7/12/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by timo):

Duplicate of #17988 in which @akaariai suggests changing the current
behavior would be backwards-incompatible (of course, all bug fixes are --
I guess it's whether or not you consider the current design a bug or a
feature). This is what Jacob meant by "related objects will never get
deleted by anyone" -- the pull request solves this by a documentation
update which informs users they must handle `formset.deleted_objects`
manually.

IMO, the justification for changing the behavior is that it's unexpected
that anything DB related happens with `commit=False`.

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:13>

Django

unread,
Jul 19, 2013, 10:30:45 AM7/19/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by timo):

[https://groups.google.com/forum/#!topic/django-developers/fJGN0ZyC-AU
django-dev thread] hasn't received any responses in an attempt to get a
design decision.

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:14>

Django

unread,
Jul 19, 2013, 11:13:44 AM7/19/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by loic84):

+1 for this PR.

As mentioned on IRC, this together with formally documenting
`ModelFormSet.(new|changed|deleted)_objects` is IMO the cleanest solution
to this problem.

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:15>

Django

unread,
Jul 23, 2013, 4:26:31 PM7/23/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"65e03a424e82e157b4513cdebb500891f5c78363"]:
{{{
#!CommitTicketReference repository=""
revision="65e03a424e82e157b4513cdebb500891f5c78363"
Fixed #10284 -- ModelFormSet.save(commit=False) no longer deletes objects

Thanks laureline.guerin@ and Wedg.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:16>

Django

unread,
Dec 11, 2013, 2:40:28 PM12/11/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Simon Charette <charette.s@…>):

In [changeset:"de1d5d5df5238136e8cd114e36065857bee1ace4"]:
{{{
#!CommitTicketReference repository=""
revision="de1d5d5df5238136e8cd114e36065857bee1ace4"
[1.6.x] Fixed #21594 -- Added note about model formsets deleting objects.

This behavior has been fixed in 65e03a424e. refs #10284.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:17>

Django

unread,
Dec 11, 2013, 2:48:12 PM12/11/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Simon Charette <charette.s@…>):

In [changeset:"a53820b1b1747d6f9b5ee5723aa7526ededdaba7"]:
{{{
#!CommitTicketReference repository=""
revision="a53820b1b1747d6f9b5ee5723aa7526ededdaba7"
[1.5.x] Fixed #21594 -- Added note about model formsets deleting objects.

This behavior has been fixed in 65e03a424e. refs #10284.

Backport of de1d5d5df5 from stable/1.6.x.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:18>

Django

unread,
Dec 11, 2013, 2:50:56 PM12/11/13
to django-...@googlegroups.com
#10284: ModelFormSet - objects are deleted even if commit=False
------------------------------------+------------------------------------
Reporter: laureline.guerin@… | Owner: Wedg
Type: Bug | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by Simon Charette <charette.s@…>):

In [changeset:"474e7dd6d08105fce66d7f62670a6c120c0b1198"]:
{{{
#!CommitTicketReference repository=""
revision="474e7dd6d08105fce66d7f62670a6c120c0b1198"
[1.4.x] Fixed #21594 -- Added note about model formsets deleting objects.

This behavior has been fixed in 65e03a424e. refs #10284.

Backport of de1d5d5df5 from stable/1.6.x.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/10284#comment:19>

Reply all
Reply to author
Forward
0 new messages