We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d3810f commit 1e336efCopy full SHA for 1e336ef
rest_framework/relations.py
@@ -89,8 +89,8 @@ def use_pk_only_optimization(self):
89
90
def get_attribute(self, instance):
91
if self.use_pk_only_optimization() and self.source_attrs:
92
+ # Optimized case, return a mock object only containing the pk attribute.
93
try:
- # Optimized case, return a mock object only containing the pk attribute.
94
instance = get_attribute(instance, self.source_attrs[:-1])
95
return PKOnlyObject(pk=instance.serializable_value(self.source_attrs[-1]))
96
except AttributeError:
0 commit comments