Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
Thanks, you are right. My generic form template accesses forms errors and they get populated. This is behavior seems a little strange but other way (errors being populated only when is_valid is called) would have different complications I guess. FYI, in my blog app, a blog item has several entri

Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread Karen Tracey
On Fri, Jun 27, 2008 at 12:10 PM, omat <[EMAIL PROTECTED]> wrote: > > Thanks for the clarification. > > Apparently my demo case of the problem was not appropriate, but my > real problem is still there. > > I have 2 ModelForms that I want to receive data at a single form > submission. > > item_form

Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
Thanks for the clarification. Apparently my demo case of the problem was not appropriate, but my real problem is still there. I have 2 ModelForms that I want to receive data at a single form submission. item_form is required only if 'item' field of the entry_form is empty. So I build the logic

Re: ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread Arien
On Fri, Jun 27, 2008 at 10:39 AM, omat <[EMAIL PROTECTED]> wrote: > > At the instant I initialize my form, the errors dict is filled, > although the documentation says, the validation happens after form > instance's is_valid() method is called. > > [example snipped] > > Is the documention or the b

ModelForm's error dict is filled before is_valid() is called

2008-06-27 Thread omat
Hi, At the instant I initialize my form, the errors dict is filled, although the documentation says, the validation happens after form instance's is_valid() method is called. Here is the demonstration: >>> from blog.forms import ItemForm >>> from blog.models import Item >>> form = ItemForm({},