#14531: Add validate_unique flag to ModelForm.Meta
-------------------+--------------------------------------------------------
 Reporter:  wogan  |       Owner:  wogan     
   Status:  new    |   Milestone:            
Component:  Forms  |     Version:  1.2       
 Keywords:         |       Stage:  Unreviewed
Has_patch:  1      |  
-------------------+--------------------------------------------------------
 `ModelForm`'s currently have a wart in that if you override `clean()`
 you have to call `super()` to ensure that unique constraints are
 validated.

 This can lead to surprises if you haven't read the documentation closely.

 It seems to me this would be better as a property on the `Meta` class.

 Example:
 {{{
     class DontCheckForm(ModelForm):
         def clean(self):
             return self.cleaned_data
         class Meta:
             model = SomeModel
 }}}
 Becomes:
 {{{
     class DontCheckForm(ModelForm):
         class Meta:
             model = SomeModel
             validate_unique = False
 }}}

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