title: How do I structure YAML data for a many-to-many field (Python 3.9, Django 3)?
body: <p>I'm using Python 3.9 and Django 3.0.  I have defined the following models.  The second has a many-to-many relationship with the first ...</p>
  <pre><code>class CoopType(models.Model):
      name = models.CharField(max_length=200, null=False)
  
      objects = CoopTypeManager()
  
      class Meta:
          # Creates a new unique constraint with the `name` field
          constraints = [models.UniqueConstraint(fields=['name'], name='coop_type_unq')]
  
  ...
  class Coop(models.Model):
      objects = CoopManager()
      name = models.CharField(max_length=250, null=False)
      types = models.ManyToManyField(CoopType, blank=False)
      addresses = models.ManyToManyField(Address)
      enabled = models.BooleanField(default=True, null=False)
      phone = models.ForeignKey(ContactMethod, on_delete=models.CASCADE, null=True, related_name='contact_phone')
      email = models.ForeignKey(ContactMethod, on_delete=models.CASCADE, null=True, related_name='contact_email')
      web_site = models.TextField()
  </code></pre>
  <p>For the child entity, I have defined this &quot;get_by_natural_key&quot; method (the name field) ...</p>
  <pre><code>class CoopTypeManager(models.Manager):
  
      def get_by_natural_key(self, name):
          return self.get_or_create(name=name)[0]
  </code></pre>
  <p>How do I structure my YAML so that I can create a Coop with multiple types?  This YAML works fine when there is only one type</p>
  <pre><code>  pk: 243
    fields:
      name: &quot;Dill Pickle Food Co-op&quot;
      types:
      - ['food coop']
  </code></pre>
  <p>but when I try and add more than one type, like so ...</p>
  <pre><code>  pk: 243
    fields:
      name: &quot;Dill Pickle Food Co-op&quot;
      types:
      - ['store', 'food coop']
  </code></pre>
  <p>I get this error ...</p>
  <pre><code>django.core.serializers.base.DeserializationError: Problem installing fixture '/tmp/seed_data.yaml': get_by_natural_key() takes 2 positional arguments but 3 were given: (directory.coop:pk=243) field_value was '['store', 'food coop']'
  </code></pre>