Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between django's OneToOneField and django's OneToOneRel

Tags:

django

What's the main difference between django's OneToOneField and django's OneToOneRel.

When I searched I came across:

What's the difference between django OneToOneField and ForeignKey?

like image 483
acquayefrank Avatar asked Jan 27 '15 21:01

acquayefrank


1 Answers

OneToOneRel is an internal class which implements the back reference of a one to one relationship. It is not documented anywhere, not part of any public api, and is not for use in your app.

like image 178
Daniel Roseman Avatar answered Sep 25 '22 08:09

Daniel Roseman