#6845: Model validation and its propagation to ModelForms
---------------------------------+------------------------------------------
          Reporter:  Honza_Kral  |         Owner:  Honza_Kral                   
             
            Status:  new         |     Milestone:  post-1.0                     
             
         Component:  Forms       |       Version:  SVN                          
             
        Resolution:              |      Keywords:  newforms validation model 
modelform ep2008
             Stage:  Accepted    |     Has_patch:  1                            
             
        Needs_docs:  1           |   Needs_tests:  1                            
             
Needs_better_patch:  1           |  
---------------------------------+------------------------------------------
Comment (by Honza_Kral):

 Replying to [comment:59 mrts]:
 > I have nothing against gruntwork :). I'll take care of porting 0.96
 validators to `django.db.models.validators`.

 please don't put it there - it should server for form validation as well.

 Validators are functions like this:
 {{{
 def validate_something( value, all_values={}, instance=None ):
   if i_dont_like( value ):
     raise ValidationError( 'I dont like %r' % value,
 error_code=validators.SOME_CODE )
 }}}
 where error code is some constant that will later be used to remap the
 default errors in custom_messages

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