Google News
logo
Django - Interview Questions
Difference between Django OneToOneField and ForeignKey Field?
Both of them are of the most common types of fields used in Django. The only difference between these two is that ForeignKey field consists of on_delete option along with a model’s class because it’s used for many-to-one relationships while on the other hand, the OneToOneField, only carries out a one-to-one relationship and requires only the model’s class.
Advertisement