[Answered ]-Django updating values to OneToOneField field

2👍

ManyToManyFields and Foreignkey fields create a object.relation_set property on the object you can follow, but OneToOneFields do not. Instead you use object.relation directly (since we know there’s only one).

So try q.userprofile.create(bio="check") instead!

(Bonus tip: Whenever you want to see the properties of a python object, use the dir() method, it will show you the full list of properties available!)

Leave a comment