I am using a one to one relationship between two models and I need to be able to clear that relationship. However, I cannot find a way to clear(clear(), remove(), etc…) it to remove that relationship, and the Django admin will not perform that operation. Does anyone have experience with this problem? I think I may have to skip the one to one field and use a one to many with unique=true set on the field.
Edit: I should have mentioned. I do have null=True set on the field, but it does not make a difference.
just set it to None and save 🙂
edit: By the way, this only works for the model that you defined the
OneToOneFieldon. I’m not sure how you would go about doing this backwards, except for:But that’s just the same as doing:
and then continuing like the first example.