#11418: formset.cleaned_data raises AttributeError when is_valid is True
---------------------+------------------------------------------------------
 Reporter:  adurdin  |       Owner:  nobody    
   Status:  new      |   Milestone:            
Component:  Forms    |     Version:  SVN       
 Keywords:           |       Stage:  Unreviewed
Has_patch:  0        |  
---------------------+------------------------------------------------------
 With a formset with no initial forms and empty extra forms,
 `formset.is_valid()` returns True, but `formset.cleaned_data` raises an
 AttributeError.

 This can be found with the examples from
 [http://docs.djangoproject.com/en/dev/topics/forms/formsets/ the formsets
 docs]:
 {{{
 >>> from django import forms
 >>> class ArticleForm(forms.Form):
 ...     title = forms.CharField()
 ...     pub_date = forms.DateField()
 ...
 >>> from django.forms.formsets import formset_factory
 >>> ArticleFormSet = formset_factory(ArticleForm)
 >>> formset = ArticleFormSet({})
 >>>
 >>> formset.is_valid()
 True
 >>> formset.errors
 [{}]
 >>> formset.cleaned_data
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Users/andy/dev/django/dj/django/forms/formsets.py", line 128, in
 _get_cleaned_data
     return [form.cleaned_data for form in self.forms]
 AttributeError: 'ArticleForm' object has no attribute 'cleaned_data'
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11418>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to