here is how I’m testing formset:
>>>data = {'pfix-0-fname':'','pfix-0-lname':'','pfix-0-relation':'','pfix-0-dob_month':'','pfix-0-dob_day':'','pfix-0-dob_year':'','pfix-1-fname':'','pfix-1-lname':'','pfix-1-relation':'','pfix-1-dob_month':'','pfix-1-dob_day':'','pfix-1-dob_year':'','pfix-INITIAL_FORMS':'0','pfix-TOTAL_FORMS':'2'}
>>>ffact = formset_factory(Form,extra=2)
>>>fset = ffact(data,prefix='pfix')
>>>fset.is_valid()
True
>>>fset.cleaned_data
[{},{}]
But if i provide any wrong data in onefield then validation is working for that form.All my fields were made required=True even then it din’t help.Any ideas why this is so.Thanks.
I’m not sure if this is the reason but it worked fine.
setting the relation field’s initial to current date did solve the issue.
I think setting any of the fields should make it work but i preferred this one as its not apt type for that field and triggers errors and is not something displayed.