title: Django save 2 forms on single page, populate foreign key automatically
body: <p>I have two forms: one that takes user information (name, birthdate, etc): formA. And another one that contains a textfield the user can input text into: formB.</p>
  
  <p>formB's model has the actual textfield, and a "name" that links it to the user this text belongs to. This field is called text_name. text_name is a foreign key linked to the Name model (that's linked to formA).</p>
  
  <p>In my view's template, I am only allowing the user to see the textbox they can input information into from formB, and they can also see all the fields in formA.
  This means the text_name dropdown box is not displayed.</p>
  
  <p>formA is currently being prepopulated with data from a different session.</p>
  
  <p>This is my view:</p>
  
  <pre><code>def name(request):
  
      ses = request.session.get('ses',  None)
  
      formA = Name_Form(request.POST, instance = ses)
      formB = Text_Form(request.POST or None)
      formB.text_name = ses
  
      if request.method == 'POST':
              formB.text_name = ses
              if formA.is_valid() and formB.is_valid():
                      formB.note_job = ses
                      a = formA.save()
                      a.save()
                      b = formB.save()
                      b.save()
  </code></pre>
  
  <p>formB is not valid because text_name is not being populated. I tried populating using this line:</p>
  
  <pre><code>formB.text_name = ses
  </code></pre>
  
  <p>but that did not work.</p>
  
  <p>How do I automatically populate text_name with the information inputted already without actually displaying text_name in my template and therefore forcing the user to actually choose the appropriate text_name manually.</p>