Re: newforms is_valid issue

2007-05-02 Thread maeck
d = Person.objects.get(id=1) p = forms.models.form_for_instance(d) f=p() After I do this both "f.is_valid()" and "f.is_bound" are false. However, there is correct data in the form if I do "print f" (and that confuses me). An alternative way I tried was: d = Person.objects.get(id=1) p = forms

Re: newforms is_valid issue

2007-05-01 Thread Malcolm Tredinnick
On Tue, 2007-05-01 at 21:21 -0700, maeck wrote: > oops, did not use form_for_instance(d). > However, is_valid is not telling me that the form is correct. > What am I doing wrong? Well, if f.bound is True and f.is_valid() is false, f.errors will contain the validation errors. That would be a good

Re: newforms is_valid issue

2007-05-01 Thread maeck
oops, did not use form_for_instance(d). However, is_valid is not telling me that the form is correct. What am I doing wrong? >>> d = Person.objects.get(id=1) >>> p = forms.models.form_for_instance(d) >>> f=p() >>> print f Name: Country: - USA Netherlands Addr1: Addr2: Addr3: Addr4: O

newforms is_valid issue

2007-05-01 Thread maeck
I am confused about the following: If I get a previous saved record, transform it into a form instance and then create a form out of it, the data is not valid nor bound (see below). However, if I print out the form, all fields are populated correctly. Am I missing a step? Thanks, Marcel >>> d =