#12513: UnresolvableValidationError far too greedy
---------------------------------------------+------------------------------
          Reporter:  skyl                    |         Owner:  nobody
            Status:  new                     |     Milestone:        
         Component:  Forms                   |       Version:  SVN   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  0     
        Needs_docs:  0                       |   Needs_tests:  0     
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by skyl):

  * summary:  UnresolvableValidationError far too greedy line ~ =>
              UnresolvableValidationError far too greedy

Comment:

 {{{
 >>> profile_form = SecretQuestionForm({})
 >>> SecretQuestionForm.base_fields
 {'secret_question': <django.forms.fields.CharField object at 0xa8557ec>,
 'answer': <django.forms.fields.CharField object at 0
 xa85588c>}
 >>> profile_form.errors # I really only want errors from the included
 fields
 {'answer': [u'This field is required.'], 'primary_contact': [u'This field
 cannot be null.'], 'secret_question': [u'This field
  is required.'], 'user': [u'This field cannot be null.']}
 >>> form = SecretQuestionForm( {"secret_question":"foo", "answer":"bar"} )
 # I want this to be .is_valid()
 >>> form.errors
 {'primary_contact': [u'This field cannot be null.'], 'user': [u'This field
 cannot be null.']}
 >>> form.is_valid() # this would be Unresolvable but for my hacks ...
 False
 }}}

 I think that maybe a Meta option in the modelform specifying whether or
 not to check fields that aren't included would be prudent.

 The current trunk breaks vast swaths of my 1.1 code.  So, for backwards
 compatibility I would vote for the modelform behaving like it used to as
 default.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12513#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 [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