[Answered ]-"This field cannot be null" error in a django 1.5 ModelForm

2👍

Answer is described here

In a nutshell the UmsContacts model is using an IntegerField so it has to be specified to create a new object like this one even if the auto-increment is set on the database table. The solution was to change it to AutoField as well as to return modified self.cleaned_data['contact'] in clean_contact method.

👤Alex

Leave a comment