title: cant pass initial values to a formset using curry
body: <p>as per this SO question <a href="https://stackoverflow.com/questions/622982/django-passing-custom-form-parameters-to-formset">Django Passing Custom Form Parameters to Formset</a> im tryin to use curry to pass a dictionary of initial values to my formset.</p>
  
  <p>its not working, it gives me a formset of empty values, which isn't what its supposed to do. </p>
  
  <p>can anyone see if im implementing this wrong?</p>
  
  <pre><code>data = {'supplier': input_data['supplier'],}
  
  InstanceFormSet = formset_factory(BulkAddInstanceForm, extra=int(input_data['copies']))
  InstanceFormSet.form = staticmethod(curry(BulkAddInstanceForm, data))
  </code></pre>
  
  <p>EDIT: as requested</p>
  
  <pre><code>class BulkAddInstanceForm(forms.Form):
      def __init__(self, *args, **kwargs):
          super(BulkAddInstanceForm, self).__init__(*args, **kwargs)
  
          self.fields['supplier'] = forms.ModelChoiceField(
              queryset=Supplier.objects.all(),
              label='Supplier',
              empty_label='Select a Supplier...',
              required=True,
          )
          self.fields['syllabus'] = forms.ModelChoiceField(
              queryset=Syllabus.objects.all(),
              label='Syllabus',
              empty_label='Select a Syllabus...',
              widget=FilterWidget(
                  queryset=Syllabus.objects.all(),
                  parent_queryset=Supplier.objects.all(),
                  control_name='supplier',
                  parent_attr='supplier',
              ),
              required=False,
          )
          self.fields['venue'] = forms.ModelChoiceField(
              queryset=Venue.objects.all(),
              label='Venue',
              empty_label='Select a Venue...',
              widget=FilterWidget(
                  queryset=Venue.objects.all(),
                  parent_queryset=Supplier.objects.all(),
                  control_name='supplier',
                  parent_attr='supplier',
              ),
              required=False,
          )
      start_date = NiceDateField(required=False, label='Start Date')
      residential = forms.BooleanField(label='Res?', required=False)
      special_offers = forms.BooleanField(label='S/O?', required=False)
      manual_price = forms.IntegerField(required=False)
      manual_cost = forms.IntegerField(required=False)
  </code></pre>
  
  <p>edit2: FAO Brandon</p>
  
  <p>I have looked at the docco and it suggests to do a different thing.</p>
  
  <pre><code>formset = formset_factory(BulkAddInstanceForm, extra=int(input_data['copies']))
  formset = InstanceFormSet(initial=[data, ])
  </code></pre>
  
  <p>which creates a formset with 'copies' amount of forms, plus another one with the data in.
  if i do this</p>
  
  <pre><code>formset = InstanceFormSet(initial=[data, data])
  </code></pre>
  
  <p>then i get two extra forms with the data in.
  so my idea is i need an iterator to add 'copies' number of dictionaries and zero the initial number of forms in the formset. </p>
  
  <p>not that i know how to cod that yet!!</p>