#12525: ModelForm validation doesn't work like documented
-----------------------------------------------------+----------------------
          Reporter:  Bernd Schlapsi <b...@gmx.info>  |         Owner:  nobody   
 
            Status:  reopened                        |     Milestone:  1.2      
 
         Component:  Documentation                   |       Version:  SVN      
 
        Resolution:                                  |      Keywords:  
Validators
             Stage:  Unreviewed                      |     Has_patch:  0        
 
        Needs_docs:  0                               |   Needs_tests:  0        
 
Needs_better_patch:  0                               |  
-----------------------------------------------------+----------------------
Changes (by korpios):

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

Comment:

 Actually, there's a deeper problem here as well: if you don't call the
 super `.clean()` method from a `ModelForm` subclass that overrides
 `.clean()`, your `ModelForm` instance never gets updated with the values
 from your passed-in data(!).  This is because the update happens via a
 call to construct_instance in `ModelForm.clean()`, and `ModelForm.save()`
 assumes that cleaning has already happened and therefore passes
 `construct=False` to `save_instance`.  This is a fairly significant
 backward-incompatible change that needs to be documented.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12525#comment:6>
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-upda...@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