What's the difference between django onetoonefield and foreignkey?



What's the difference between django onetoonefield and foreignkey?..

Answer / Mohan Chandra

A Django OneToOneField creates a one-to-one relationship between two models, where each instance of one model can have only one related instance from another model. A ForeignKey, on the other hand, allows multiple instances of one model to be related to one instance of another model.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Django Python Interview Questions

What are population websites built on django ?

1 Answers  


List out the inheritance styles in django?

1 Answers  


Explain inheritance in python with an example ?

1 Answers  


How to get current page uri in django template.

1 Answers  


What is verbose_name in django?

1 Answers  


Why is django so popular?

1 Answers  


What is jinja in django?

1 Answers  


Can I learn django without python?

1 Answers  


Do you need to know python to use django?

1 Answers  


Is django better than php?

1 Answers  


What is the difference between the range & x range?

1 Answers  


What does django-admin.py makemessages command is used for?

1 Answers  


Categories