我正在将用户的教育添加到他的用户配置文件中。用户可能有多个条目用于他的教育。我是否应该使用基本的M2M关系,例如 -是否在M2M关系中使用直通模型
class Education(models.Model):
school = models.CharField(max_length=100)
class_year = models.IntegerField(max_length=4, blank=True, null=True)
degree = models.CharField(max_length=100, blank=True, null=True)
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
educations = models.ManyToManyField(Education)
或者我应该为这种关系使用直通模型?谢谢。