title: Django populating initial data in formset
body: <p>This may be a rather simple problem. But I am trying to populate my form with initial data taken from a database. I don't really know where to start. Any advice would help. </p>
  
  <p>Some background: I have a disease with multiple indicators. In my form I am pulling disease_id = 2 then wanting to populate the indicators currently in the database, so they may be edited. </p>
  
  <p>views.py</p>
  
  <pre><code>def drui(request):
  
  disease_id = request.GET.get('disease_id', '2')
  
      if request.method == "POST":
  
         disease = get_object_or_404(Disease, pk=disease_id)
         diseaseForm = DiseaseForm(request.POST, instance=disease)
  
         if diseaseForm.is_valid():
            new_disease = diseaseForm.save(commit=False)
            indicatorInlineFormSet = IndicatorFormSet(request.POST, request.FILES, instance=new_disease)
  
            if indicatorInlineFormSet.is_valid():
               new_disease.save()
               indicatorInlineFormSet.save()
               return HttpResponseRedirect(reverse(somewhere))
  
       else:
         diseaseForm = DiseaseForm()
         indicatorInlineFormSet = IndicatorFormSet(instance=Disease())
  
      return render_to_response("drui.html", {'diseaseForm': diseaseForm, 'indicatorInlineFormSet': indicatorInlineFormSet},context_instance=RequestContext(request))   
  </code></pre>