title: Django-formwizard and ModelFormSet save
body: <p>I am rewriting a big piece of our application which requires a user to create a <code>Project</code> with <code>Rewards</code> attached to it.</p>
  
  <p>The form is broken into different steps, the first two are the normal <code>Project</code>, the next one is the <code>Rewards</code>, and then lastly a simple preview that lets the user flick back and forth to create a perfect <code>Project</code>.</p>
  
  <p><strong>my forms.py</strong></p>
  
  <pre><code>class BaseRewardFormSet(BaseModelFormSet):
      def __init__(self, *args, **kwargs):
          super(BaseRewardFormSet, self).__init__(*args, **kwargs)
          self.queryset = Reward.objects.none()
  
  RewardFormSet1 = modelformset_factory(Reward, extra=2, exclude=('project'), formset=BaseRewardFormSet)
  
  class ProjectForm1(forms.ModelForm):
      """docstring for ProjectForm1"""
      class Meta:
          model = Project
          exclude=( ... )
  
  class ProjectForm2(forms.ModelForm):
      """docstring for ProjectForm2"""
      class Meta:
          model = Project
          exclude = ( ... )
  </code></pre>
  
  <p><strong>my urls.py</strong></p>
  
  <pre><code>instance_dict = {'2': Reward.objects.none()}
  url(r'^new-project/$', login_required(ProjectWizard.as_view([ProjectForm1, ProjectForm2, RewardFormSet1, ProjectForm3], instance_dict=instance_dict))),
  </code></pre>
  
  <p><strong>my views.py</strong></p>
  
  <pre><code>class ProjectWizard(SessionWizardView):
      file_storage = cloudfiles_storage
  
      def get_context_data(self, form, **kwargs):
          context = super(ProjectWizard, self).get_context_data(form, **kwargs)
          initial_dict = self.get_form_initial('0')
          if self.steps.current == '1':
              step1_data = self.get_cleaned_data_for_step('0')
              context.update({'step1_data':step1_data,'currency_sign':step1_data['base_currency']})
          else:
              step1_data = self.get_cleaned_data_for_step('0')
              step2_data = self.get_cleaned_data_for_step('1')
              step3_data = self.get_cleaned_data_for_step('2')
              context.update({'step1_data':step1_data,'step2_data':step2_data,'step3_data':step3_data,})
          return context
  
      def get_template_names(self):
          step = int(self.steps.current)
          if step == 3:
              return 'formwizard/preview.html'
          else:
              return 'formwizard/wizard_form.html'
  
      def done(self, form_list, *args, **kwargs):
          form_data = form_list[0].cleaned_data
          form_data_details = form_list[1].cleaned_data
          form_data.update(form_data_details)
          project = Project()
          for field in project.__dict__.iterkeys():
              if field in form_data:
                  project.__dict__[field] = form_data[field]
          project.owner = self.request.user
          project.date_published = datetime.now()
          project.save()        
          return render_to_response('formwizard/done.html', {
              'form_data': [form.cleaned_data for form in form_list],
          })
  </code></pre>
  
  <p>when rendering redirect, it shows that all the data has been cleaned which means that the form is valid, and all the project data is saved to <strong>Project</strong></p>
  
  <p>I can see that the Rewards data will not save since it has not been called, but every solution I have tried thus far has failed.</p>
  
  <p><strong>How can I implement Rewards into this solution on save?</strong></p>
  
  <p>Maybe someone can shed some light on this, much appreciated!</p>