#11830: save_model in ModelAdmin and inline model formsets
-------------------------------------------+--------------------------------
          Reporter:  nfg                   |         Owner:  nobody         
            Status:  new                   |     Milestone:                 
         Component:  django.contrib.admin  |       Version:  1.1            
        Resolution:                        |      Keywords:  save_model save
             Stage:  Unreviewed            |     Has_patch:  1              
        Needs_docs:  0                     |   Needs_tests:  0              
Needs_better_patch:  0                     |  
-------------------------------------------+--------------------------------
Changes (by nfg):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Perhaps a hook like save_model should be added (post_save_model?). This
 would be called after the save_formsets have been called on the formsets.
 This will however not solve the problem of changing or deleting related
 objects from the model's save method.

 I also discovered a problem with my naiv solution. It makes the data
 submitted in the form the master, data changed in the save method or the
 save_model method will be overwritten. It is a design decision whether the
 save method or the form data should be the master. Added a test for this
 in the patch. The test assumes the form data is the master.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11830#comment:1>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to