方式一:

class Boy(models.Model):
username=models.CharField(max_length=16)
class Girl(models.Model):
username=models.CharField(max_length=16)
b=models.ManyToManyField("Boy")


方式er


class BTG(models.Model):
b_id=models.ForeignKey("Boy")
g_id=models.ForeignKey("Girl")


class Boy(models.Model):
username=models.CharField(max_length=16)
class Girl(models.Model):
username=models.CharField(max_length=16)