Django OneToOneField RelatedObjectDoesNotExist
#python #django #english
This is most useful as the primary key of a model which “extends” another model in some way;but sometimes it may cause RelatedObjectDoesNotExist if the certain one doesn't exist.
take a example from stackoverflow Django : OneToOneField - RelatedObjectDoesNotExist
it will be ok,if we only use Answer:
when it comes to Vote:
How to avoid this ? Of course,you can catch the error simply
Django : OneToOneField - RelatedObjectDoesNotExist