Hi, On Apr 20, 8:00 am, legutierr <leguti...@gmail.com> wrote: > modelform.is_valid() fails to anticipate database integrity errors > when those errors involve any fields that are not part of that form > itself.
That is wanted behaviour, eg consider my workflow: class SomeForm(ModelForm): class Meta: exclude = ['user'] model = … Now in the view I do this: if form.is_valid(): instance = form.save(commit=False) instance.user = request.user Now assume user is a not nullable Foreignkey. In that case the is_valid on the form would throw an error -> BAD. The issue you describe (fields not beeing run through model validation if not on the form) got "added" after adding model validation, since the code I describe is pretty common and would have broken all those apps. I suggest you read the history on the development of modelvalidation; especially: http://groups.google.com/group/django-developers/browse_thread/thread/cee43f109e0cf6b Btw, just my humble opinion: If you exclude fields from the ModelForm it's your duty to check for valid data. Regards, Florian -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.