Whats the difference between a OneToOne, ManyToMany, and a ForeignKey Field in Django?
问题 I'm having a little difficulty getting my head around relationships in Django models. Could someone explain what the difference is between a OneToOne, ManyToMany and ForeignKey? 回答1: Well, there's essentially two questions here: What is the difference (in general) between one to one, many to many, and foreign key relations What are their differences specific to Django. Both of these questions are quite easily answered through a simple Google search, but as I cannot find an exact dupe of this