Re: Django ModelForm is_valid & form_valid

2013-06-20 Thread Jacob Valenta
Thank you good sir! You have put an end to my week long head ache! On Thursday, June 20, 2013 12:27:36 PM UTC-4, Jason Arnst-Goodrich wrote: > > This is a common problem to run into. > > def form_valid(self, form): > > customer = form.save(commit=False) > > customer.store =

Re: Django ModelForm is_valid & form_valid

2013-06-20 Thread Jason Arnst-Goodrich
This is a common problem to run into. def form_valid(self, form): customer = form.save(commit=False) customer.store = self.request.user.active_profile.store customer.save() return super(CustomerInformationView, self).save(form) super(CustomerInformationView, self).save(form)doesn't really

Django ModelForm is_valid & form_valid

2013-06-20 Thread Jacob Valenta
Basically, I have a model, a ModelForm, and an UpdateView. I go to the UpdateView (viewing a current customer) and just hit the submit button (changing no data). What results is an error from the model: *Cannot assign None: "Customer.store" does not allow null values.* (*I do not have a field