title: Django related model not updating on form submission
body: <p>How do I update a non existing related object  through Django model forms ?</p>
  <p>I have two objects: Participant and Emergency. Emergency is a child of participant like if  run the query:  <code>participant = ParticipantInfo.objects.get(pk = prk)</code> I can access <code>emergency = participant.emergency</code>.</p>
  <p>I cannot update emergency with data from a form using a POST request.
  Can anyone help me please.
  Thanks</p>
  <p><a href="https://i.stack.imgur.com/oPlQr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oPlQr.png" alt="![The participant table" /></a></p>
  <p>Here's my models.py for clarity.</p>
  <p><strong>models.py</strong></p>
  <pre><code>class EmergencyInfo(models.Model):
      first_name = models.CharField(max_length=100)
      last_name = models.CharField(max_length=100)
      phone_number = models.CharField(max_length=50)
      email = models.EmailField(max_length=100, blank=True, verbose_name=&quot;Emergency Contact Email&quot;)
      relationship = models.CharField(max_length=100)
  
  
  class ParticipantInfo(models.Model):
      first_name = models.CharField(max_length=100)
      middle_initial = models.CharField(max_length=1, blank=True)
       emergency = models.ForeignKey(EmergencyInfo, on_delete = models.CASCADE, editable= False, null=True, blank=True)
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>def update_participant(request, pk):
      # this function comes after update_specific 
      if request.method == &quot;GET&quot;:
          forms = get_participant_form_data(pk)
          context = {'forms': forms, 'pk': pk}
          return render(request, 'core/participantinfo_update_form.html', context)
       if request.method == &quot;POST&quot;:
          return update_specific_form(request, pk)
  
  
  def update_specific_form(request, pk):
      participant = ParticipantInfo.objects.get(pk = pk)
      
      # if the object didn't exist create it like normal      
      if participant.emergency is None:
          emergencyform =EmergencyForm(request.POST)
          if (emergencyform.is_valid):
              emergencyform.save()
              messages.success(request, 'saved')
              return redirect(request.path_info)
      # if the object exists, update it
      if participant.emergency is not None:
          emergencyform = EmergencyForm(request.POST, instance = participant.emergency)           
          if (emergencyform.is_valid):
              emergencyform.save()
              messages.success(request, 'saved')
              return redirect(request.path_info)
  </code></pre>