title: Readable nested serializer with many2many in django REST
body: <p>I am running a django app using REST to send data to my API. </p>
  
  <p>I have a network that contains many projects and a project can belong to many networks.</p>
  
  <p>I want to send this dataset via requests:</p>
  
  <pre><code>payload =  {
              "name": "my great testnetwork",
              "type_network": "xyz",
              "projects" : [
                  {
                      "project_name": "Brasil",
                  },
                  {
                      "project_name": "Sweden",
                  },
              ],
  
              "creation_date": "2020-05-15T15:57:27.399455Z"
      } 
  </code></pre>
  
  <p>I do not want to create the project_names, they are already in the database. I only want this to work like a normal FK, where I specify the project_name and it shows in my API. It should only relate them. </p>
  
  <p><strong>What happens now is that the project list remains empty when I send it like this</strong></p>
  
  <p>This is what I get:</p>
  
  <pre><code>{
      "id": 6,
      "name": "my great test",
      "type_network": "xyz",
      "projects": [],
      "creation_date": "2020-05-15T19:00:05.947542Z"
  }
  </code></pre>
  
  <p>But I need the projects in the list. </p>
  
  <p>My serializer looks like this:</p>
  
  <pre><code>
  class NetworkSerializer(serializers.ModelSerializer):
      """Serializer for Network.
  
      Add extra field buildings from NestedProjectSerializer.
      """
  
      projects = NestedProjectSerializer(
          many=True,
          read_only=True,
          help_text="Many to many relation. Project instances expected."
      )
  
      class Meta:
          model = Network
          fields = (
              'id',
              'name',
              'projects',
              'creation_date',
          )
  
  </code></pre>
  
  <p>Ok so I tried to overwrite the create method for writable nested serializers, but I think I don't need this, right? Because I don't want to create new objects. Then I also tried to use the <code>PrimaryKeyRelatedField</code>, but i get either the error that <code>pk is not valid</code> (when passing a queryset) or it doens't show the projects (when using read-only=True). </p>
  
  <p>I am a bit stuck here. Can someone lend me a hand? Thanks so much for your time and help. Appreciated very much!</p>
  
  <p>I am happy to provide more code or clarifications if needed.</p>
  
  <p>My models:</p>
  
  <pre><code>
  class Project(models.Model):
      project_name = models.CharField(max_length=120, primary_key=True, unique=True)
      location = models.CharField(max_length=120, null=True, blank=True)
  
  
  class Network(models.Model):
  
      name = models.CharField(
          max_length=120,
          null=True,
          blank=True,
          help_text="Name of network. String expected."
      )
  
      projects = models.ManyToManyField(
          Project,
          default=None,
          blank=True,
          help_text="Many to many relation. Project instances expected."
      )
  
      creation_date = models.DateTimeField(
          auto_now=True
      )
  
  </code></pre>
  
  <p>I'm getting the feeling that I have to overwrite the create method... the project_name is the pk btw.</p>
  
  <p>EDIT: Sending data like this: </p>
  
  <pre><code>
  payload =  {
              "name": "my great testnetwork",
              # "projects" : [
              #     {
              #         "project_name": "frankfurt",
  
              #     }
              # ],
              "projects_data" : [
                  {
                      "project_name": "Brasil",
  
                  }
              ],
  
              "creation_date": "2020-05-15T15:57:27.399455Z"
      }   
  
  r = requests.request('post', 'http://localhost:8000/myendpoint', json=payload, headers=headers)
  print(r.text)
  print(r.status_code)
  
  </code></pre>