Re: OneToOneField value must be a model instance, not a value?

2019-01-02 Thread Kuber Sodari
>From official documentation "*to_field* is the field on the related object that the relation is to. By default, Django uses the primary key of the related object. If you reference a different field

OneToOneField value must be a model instance, not a value?

2019-01-02 Thread regtech
Hello everyone! I am a junior who is first using OneToOneField, I found that the value which is giving to the field only could be a instance of the related model, can't be a value of the field which is specifed by the "to_field" ( else django will raise excption ). In the other word, "to_field"