Django inlineformset - 'CapForm' object has no attribute 'cleaned_data'
<p>I am facing attribute error,</p>

<pre><code>'CapForm' object has no attribute 'cleaned_data'
</code></pre>

<p>This is my post method</p>

<pre><code>def post(self,request,*args,**kwargs):
        user = request.user.id
        form = SesForm(request.POST,request.FILES,user=request.user)
        if form.is_valid():
            frm = form.save(commit=False)
            frm.user = request.user
            frm.status = False
            obj = frm.save()

            cap_formset = CapFormSet(request.POST)
            cap_formset.instance = frm    # Tried obj also it throws - 'NoneType' object has no attribute '_state'
            cap_formset.save()
</code></pre>

<p><strong>My Form</strong></p>

<pre><code>class CapForm(forms.ModelForm):
    title = forms.CharField(label=_('Cap'))
    class Meta:
        model = Cap
        fields = ('title',)
    def __init__(self,*args,**kwargs):
        super(CapForm,self).__init__(*args,**kwargs)
        for name, field in self.fields.iteritems():
            field.widget.attrs.update({'class': 'form-control', 'placeholder': field.label})
</code></pre>

<p><strong>Formset declaration</strong></p>

<pre><code>CapFormSet = inlineformset_factory(Ses, Cap, form=CapForm, extra=1, can_delete=True)
</code></pre>

<p>Can any one help me pointing where the issue is</p>

<p>You've called <code>is_valid</code> on SesForm, but not on CapFormSet.</p>

python django