In django, what's the difference between a ManyToOneRel and a ForeignKey field?
Asked
Active
Viewed 2.9k times
2 Answers
54
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.

Yauhen Yakimovich
- 13,635
- 8
- 60
- 67
49
ManyToOneRel
is not a django.db.models.fields.Field
, it is a class that is used inside Django but not in the user code.

wRAR
- 25,009
- 4
- 84
- 97