Closed wojcikstefan closed 4 years ago
@wojcikstefan seems like there is a relevant test failing still. Tag me again for review when it's fixed (and if you feel inclined feel free to add another test).
Hm, that test makes sense though... Calling fetch_related
should not make the objects we call it on lose the IDs of their broken references. I think I opened this PR prematurely.
It could be an interesting idea to attach a "missing" sentinel value to these broken references which would:
DoesNotExist
.But that's just a minor optimization and not a major behavioral change that I was going for here.
This is an attempt at fixing an issue where a broken reference of a
ReferenceField
is never resolved. I'm not 100% sure that it always makes sense to resolve broken references toNone
s, but I think it's worth considering.Example usage: