#6652: Allow 'clean()' to specify the wrong field
----------------------------------------------------------+-----------------
          Reporter:  Daniele Varrazzo <[EMAIL PROTECTED]>  |         Owner:  
nobody  
            Status:  reopened                             |     Milestone:  
post-1.0
         Component:  Forms                                |       Version:  SVN 
    
        Resolution:                                       |      Keywords:  
feature 
             Stage:  Design decision needed               |     Has_patch:  1   
    
        Needs_docs:  0                                    |   Needs_tests:  0   
    
Needs_better_patch:  0                                    |  
----------------------------------------------------------+-----------------
Comment (by mtredinnick):

 I don't like the approach proposed here now that I've looked at it a bit
 more. `ValidationError` is an exception that should be raised and is then
 caught by the outer loop (in normal single-field processing) and stored in
 the `ErrorList`. A validation error is the exception instance, not tied to
 a field. The conceptual problem here is that `Form.clean()` is for
 validating multiple fields at once, so you don't want to raise an
 exception on the first problem: you still want to handle all errors and
 it's not part of some outer loop that gets called again and again.

 Documenting `_errors`, which is designed to hold the errors and can be
 happily used by subclasses is a better approach here. I'll do that today
 and then close this.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6652#comment:18>
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