title: How to extend a model with many optional models in django?
body: <p>Say I have a master model with several optional slave models:</p>
  <pre><code>   class Master(models.Model):
          field_m1 = models.IntegerField(default=0)
          field_m2 = models.IntegerField(default=0)
  
     class slave1(models.Model):
          field_s11 = models.OneToOneField(
          Master,
          on_delete=models.CASCADE,
          primary_key=True,
          )
          field_s12 = models.IntegerField(default=0)
  
     class slave2(models.Model):
          field_s21 = models.OneToOneField(
          Master,
          on_delete=models.CASCADE,
          primary_key=True,
          )
          field_s22 = models.IntegerField(default=0)
  </code></pre>
  <p>at first I create a createview and a updateview:</p>
  <pre><code>class MasterCreate(CreateView):
      model = Master
  
  class MasterUpdate(UpdateView):
      model = Master
  </code></pre>
  <p>then I use them in template <em>master_form.html</em></p>
  <pre><code>...
  &lt;form method=&quot;post&quot;&gt;{% csrf_token %}
  ...
      {{form.field_m1 }}
      {{form.field_m2 }}
  ...
  &lt;/form&gt;
  ...
  </code></pre>
  <p>everything seems OK so far, but how to integrate the slave models into the master's model
  so I can use these field in template just like use Master.field_m1 and Master.field_m2? since 2 slave models is optional, i can add them or not add in createview and add or delete them (or any of them) in updateview. Could it be implement using generic edit view?</p>