Re: Basic ModelForm operation question

2008-04-22 Thread zmalloc
Unless your model has defined columns with unique_together, and the form attempts to save fields which violate the constraint. In that case, an integrity exception is raised because ModelForm does not currently valid it. You must perform this validation yourself. On Apr 19, 10:20 pm, Malcolm

Re: Basic ModelForm operation question

2008-04-19 Thread Malcolm Tredinnick
On Sat, 2008-04-19 at 13:18 -0700, John wrote: > If you have code like this using a form that subclasses ModelForm: > > if request.method == 'POST': > form = MyModelForm(request.POST, instance=some_instance) > form.is_valid(): >form.save() > > Does MyModelForm first fill it's fi

Basic ModelForm operation question

2008-04-19 Thread John
If you have code like this using a form that subclasses ModelForm: if request.method == 'POST': form = MyModelForm(request.POST, instance=some_instance) form.is_valid(): form.save() Does MyModelForm first fill it's fields with data from some_instance, and then override with the da