Difference between ManyToOneRel and ForeignKey?

前端 未结 2 1573
隐瞒了意图╮
隐瞒了意图╮ 2020-12-28 15:41

In django, what\'s the difference between a ManyToOneRel and a ForeignKey field?

2条回答
  •  滥情空心
    2020-12-28 16:12

    Django relations model exposes (and documents) only OneToOneField, ForeignKey and ManyToManyField, which corresponds to the inner

    • OneToOneField -> OneToOneRel
    • ForeignKey -> ManyToOneRel
    • ManyToManyField -> ManyToManyRel

    See source of django.db.models.fields.related for further details.

提交回复
热议问题