title: Pre-fill fields in a form with data from a ForeignKey class
body: <p>I have a</p>
  
  <pre><code>class SurveyAnswer(models.Model):
      rel = models.ForeignKey(Survey)
      answer = models.CharField(max_length=150)
      def __unicode__(self):
          return self.answer
  </code></pre>
  
  <p>And now i want to pre-fill a form with this "answer"s:</p>
  
  <pre><code>survey = get_object_or_404(Survey, created_by=request.user, pk=question_id)
  form_data = {"question": survey.question, "answer1":survey.surveyanswer_set.get(xxx)}
  form = SurveyForm(form_data)
  </code></pre>
  
  <p>What do i have to do with xxx so that i get e.g the first answer related to the "Survey" (ForeignKey). With pk=1 i get the absolute number.</p>
  
  <p>UPDATE:</p>
  
  <p>I have done now</p>
  
  <pre><code>{% for i in survey.surveyanswer_set.all %}
      &lt;p&gt;&lt;label&gt;Answer {{ forloop.counter }}:&lt;/label&gt; &lt;textarea id="id_answer{{ forloop.counter }}" rows="6" placeholder="Type an answer option" cols="45" name="answer{{ forloop.counter }}"&gt;{{ i.answer }}&lt;/textarea&gt;&lt;/p&gt;
  {% endfor %}
  </code></pre>
  
  <p>If somebody know how to do it nicer in views please give me a hint.</p>
  
  <p>UPDATE 2:</p>
  
  <p>This is a bit nicer in views (but i think there must be an easier solution):</p>
  
  <pre><code>answers_part1 = []
  for i in survey.surveyanswer_set.all():
      answers_part1.extend([i.answer])
  answers_part2 = ["answer1", "answer2", "answer3", "answer4"]
  answers = dict(zip(answers_part2, answers_part1))
  form_data = {"question": survey.question}
  form_data.update(answers)
  form = SurveyForm(form_data)
  </code></pre>