Changes between Initial Version and Version 1 of Ticket #11476


Ignore:
Timestamp:
Jul 14, 2009, 7:29:00 AM (15 years ago)
Author:
Karen Tracey
Comment:

Fixed formatting. Please use preview, you need three brackets, not two, to embed code.

This was answered on the mailing list as a problem with your expectations, not a bug in the code: http://groups.google.com/group/django-users/browse_thread/thread/97885473cb5b4ffd/ so I am not sure why you opened a ticket on it. If you disagree it would have been better to continue the conversation on the list. You have provided no new information/support for your viewpoint in this ticket so the answer here is the same.

Re-displaying a form after successfully processing it is not an expected pattern, nor is it good design from a usability standpoint. Doing work to fix up the form data to reflect a delete is thus a waste of time for the normal case and enabling bad design. I don't believe we should do this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11476

    • Property Resolutionwontfix
    • Property Status newclosed
  • Ticket #11476 – Description

    initial v1  
    1 I'm using a ModelFormset created with lineformset_factory.
     1I'm using a !ModelFormset created with lineformset_factory.
    22
    33When I click delete on one of the records and save the formset, it
     
    77I've modified my code to recreate the formset from the db immediately
    88after the save:
    9 {{
     9{{{
    1010 if foo_formset.is_valid():
    11                        foo_formset.save()
    12                foo_formset = FooInlineFormset(instance=bar, prefix='foo')
    13 }}
     11     foo_formset.save()
     12     foo_formset = FooInlineFormset(instance=bar, prefix='foo')
     13}}}
    1414and it does what I expect, but shouldn't it be in the right state
    1515after the save?
    1616
    17 Looking at the code I think the problem is that BaseModelFormSet
     17Looking at the code I think the problem is that !BaseModelFormSet
    1818doesn't do anything with deleted forms after it deletes the underlying
    1919model object - I'm expecting them to be removed from the formset as
Back to Top