Add validate_unique flag to ModelForm.Meta
|Reported by:||Greg Wogan-Browne||Owned by:||Greg Wogan-Browne|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||yes|
ModelForm's currently have a wart in that if you override
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
class DontCheckForm(ModelForm): def clean(self): return self.cleaned_data class Meta: model = SomeModel
class DontCheckForm(ModelForm): class Meta: model = SomeModel validate_unique = False