#10922: Model formsets - matching POST data to model instances is fragile
---------------------------------+------------------------------------------
          Reporter:  kmtracey    |         Owner:  nobody
            Status:  new         |     Milestone:        
         Component:  Forms       |       Version:  1.0   
        Resolution:              |      Keywords:        
             Stage:  Unreviewed  |     Has_patch:  0     
        Needs_docs:  0           |   Needs_tests:  0     
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Comment (by kmtracey):

 Attached updated patch.

 First, it applies against current trunk.

 Second, modified the alterations involving setting the `pk_value` in
 `add_fields` so that the old logic is used in the case where the form is
 not bound.  Without that change, the hidden pk/id fields in admin pages
 had no values set when initially displayed, resulting in even bigger
 problems if you tried to edit anything.  (It's possible I misunderstood
 how to adapt the code to current trunk, as this is the area that
 conflicted when attempting to apply the old patch.)

 Third, removed the test changes as they are also currently conflicting and
 I've run out of time for today to look at this.

 The patch I attached on a very brief initial test does seem to fix the
 problem noted in #10784.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10922#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to