My question is very similar to one by Seth Gordon in 2011. But it's been 4 years since then, so I'll try again.
I have models A and B, and B has a O2O field pointing to A. When I do `a.b.delete()`, then I'm surprised to find that `a.b` is still a valid object. How can I modify `a` so that it returns to its expected state (i.e. `a.b` throws B.DoesNotExist)? Repro app & project here: https://github.com/ezheidtmann/o2o_delete_confusion Models in question: https://github.com/ezheidtmann/o2o_delete_confusion/blob/master/maybebug/models.py Tests showing what I've tried: https://github.com/ezheidtmann/o2o_delete_confusion/blob/master/maybebug/tests.py You can see I've tried reloading the entire model from the database -- it works, but I am looking for something that takes less time and has fewer side-effects. Is there some way to reset the local cache in the Thing object? Thanks a lot! Evan -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOwivZTuFJ92G_BoFPSZTq_jZoeeeXoEC-uWGu1fnYXMt37Cmw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.