In FactoryBoy, how do I set a many-to-many field in my factory?
问题 I'm using Django 2.2 and FactoryBoy to attempt to create some factories to produce the following models ... 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