title: How to add relationships in Django fixtures by explicitly adding object's fields?
body: <p>I'm working with Django Framework. I have two models: Component and ComponentProperty.</p>
  
  <pre><code>class Component(models.Model):
      name = models.CharField(unique=True, max_length=255)
      component_properties = models.ManyToManyField(ComponentProperty)
  
  class ComponentProperty(models.Model):
      label = models.CharField(unique=True, max_length=255)
      component_type = models.CharField(max_length=255)
  </code></pre>
  
  <p>And serializers:</p>
  
  <pre><code>class ComponentSerializer(serializers.ModelSerializer):
      class Meta:
          model = Component
          fields = ('name', 'component_properties')
          depth = 1
  
  class ComponentPropertySerializer(serializers.ModelSerializer):
      class Meta:
          model = ComponentProperty
          fields = ('label', 'component_type')
  </code></pre>
  
  <p>I'm trying to load data with fixtures. I wrote and fixture file that look like this: </p>
  
  <pre><code>[
     {
        "pk":1,
        "model":"api.componentproperty",
        "fields":{
           "label":"label",
           "component_type":"text"
        }
     },
     {
        "pk":2,
        "model":"api.componentproperty",
        "fields":{
           "label":"description",
           "component_type":"text",
  
        }
     },
     {
        "pk":1,
        "model":"api.component",
        "fields":{
           "name":"text",
           "component_properties":[
              1,
              2
           ]
        }
     }
  ]
  </code></pre>
  
  <p>That's work fine! But I have 20 fixtures to load. I want to have fixture (component.json for example) look like this bellow:</p>
  
  <pre><code>[
     {
        "pk":null,
        "model":"api.component",
        "fields":{
           "name":"text",
           "component_properties":[
              {
                 "pk":null,
                 "model":"api.componentproperty",
                 "fields":{
                    "label":"label",
                    "component_type":"text"
                 }
              },
              {
                 "pk":null,
                 "model":"api.componentproperty",
                 "fields":{
                    "label":"description",
                    "component_type":"text",
  
                 }
              }
           ]
        }
     }
  ]
  </code></pre>
  
  <p>The icing on the cake must be fixtures specifying a primary key like <a href="https://stackoverflow.com/questions/1499898/django-create-fixtures-without-specifying-a-primary-key">here</a>. Please, can anyone help me to write these fixtures without pk and the relationships described above?</p>