[x ] I have reduced the issue to the simplest possible case.
[x ] I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Steps to reproduce
Select admin renderer. View a model that has a ForeignKey like origin = models.ForeignKey(Address, related_name='+') See gibberish output like <rest_framework.relations.PKOnlyObject object at 0x7f943b762950>
<rest_framework.relations.PKOnlyObject object at 0x7f9a6903d510>
Should be fairly simple to add str/unicode methods so the link text is the pk value instead of something like <rest_framework.relations.PKOnlyObject object at 0x7f9a6903d510>.
This simple monkey patch fixes the issue so I assume adding the method won't cause any problems
from rest_framework.relations import PKOnlyObject
PKOnlyObject.__str__ = lambda obj: str(obj.pk)
The text was updated successfully, but these errors were encountered: