For Django Rest Framework, what is the difference in use case for HyperLinkedRelatedField and HyperLinkedIdentityField?
The obvious answer is that HyperLinkedIdentityField is meant to point to the current object only, whereas HyperLinkedRelatedField is meant to point to something that the current object references. I suspect under the hood the two are different only in that the identity field has less work to do in order to find the related model's URL routes (because the related model is the current model), while the related field has to actually figure out the right URLs for some other model.
In other words, HyperLinkedIdentityField is lighter-weight (more efficient), but won't work for models other than the current model.
I've of course reviewed the docs, but was wondering if anyone could more succinctly explain the difference in use case and application between these fields. Why would one use one field over the other? Would there be a difference between these fields for a OneToOne relationship?