title: Django forms from "Generic related" models
body: <p>I have some models, connected with <code>GenericForeignKey</code>:</p>
  
  <pre><code>Class Main(models.Model)
      filed_1      = models.CharField(max_length=20)
      object_id    = models.PositiveIntegerField()
      content_type = models.ForeignKey(ContentType)
      object       = generic.GenericForeignKey('content_type', 'object_id')
  
  Class Additional_1(models.Model):
      f_1 = models.CharField(max_length=20)
      f_2 = models.CharField(max_length=20)
  
  Class Additional_2(models.Model):
      d_1 = models.CharField(max_length=20)
      d_2 = models.CharField(max_length=20)
  </code></pre>
  
  <p>And forms for this models:</p>
  
  <pre><code>Class MainForm(forms.ModelForm):
        class Meta:
             model  = Main
             fields = ('filed_1', 'object_id', 'content_type')
  
             widgets = {
                 'object_id': forms.HiddenInput,
                 'content_type': forms.HiddenInput
             }
  
  Class Additional_1Form(forms.ModelForm):
      class Meta:
          model  = Additional_1
          fields = ('f1', 'f2')
  
  Class Additional_2Form(forms.ModelForm):
      class Meta:
          model  = Additional_2
          fields = ('d1', 'd2')
  </code></pre>
  
  <p>How to make forms, composed of fields of <code>MainForm</code> + <code>Additional_iForm</code> in one html form  with one submit button (<code>MainForm</code> + <code>Additional_1Form</code> and <code>Main</code> + <code>Additional_2Form</code>) and provide correct creating and editing. There is way to do it using standard Django components, like inline formset for <code>ForeignKey</code>?</p>
  
  <p>P.S. I think the answer to this question should be contained in this section of the documentation, but there is too little information to answer. <a href="https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations-in-forms-and-admin" rel="nofollow">https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations-in-forms-and-admin</a></p>
  
  <p><strong>EDITION #1</strong></p>
  
  <pre><code># This is always false, because of 'object_id' in main_form
  if main_form.is_valid() and additional_1_form.is_valid():
      additional = additional_1_form.save()
      main_form.object_id = additional .id # I need something like this to set object_id 
      main_form.save()
  </code></pre>