The idea of the HyperlinkedModelSerializers is good: When you want to fetch an object that is referenced in another model, you can simply query the given URL.
However, in practice, we will always use the API wrapper to make the requests, so we can't use the full URL. Instead, we need to extract the ID from the URL and use that for the request. This is adding additional code and makes the requests more error prone.
I suggest that we just provide the normal IDs instead. This will require some refactoring, but will ultimately make the tor and buttercup requests easier.
The idea of the
HyperlinkedModelSerializer
s is good: When you want to fetch an object that is referenced in another model, you can simply query the given URL. However, in practice, we will always use the API wrapper to make the requests, so we can't use the full URL. Instead, we need to extract the ID from the URL and use that for the request. This is adding additional code and makes the requests more error prone.I suggest that we just provide the normal IDs instead. This will require some refactoring, but will ultimately make the
tor
andbuttercup
requests easier.