aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework
diff options
context:
space:
mode:
authorTom Christie2014-12-10 22:10:45 +0000
committerTom Christie2014-12-10 22:10:45 +0000
commit1e336ef30da9f7366fc68185016c4011c25e1199 (patch)
tree312e4215c272782e3db5d35331555a21daadcb9b /rest_framework
parent9d3810f313123ce48dea48f3c3f0f2cae5816bde (diff)
downloaddjango-rest-framework-1e336ef30da9f7366fc68185016c4011c25e1199.tar.bz2
Move comment
Diffstat (limited to 'rest_framework')
-rw-r--r--rest_framework/relations.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/relations.py b/rest_framework/relations.py
index a5f97596..892ce6c1 100644
--- a/rest_framework/relations.py
+++ b/rest_framework/relations.py
@@ -89,8 +89,8 @@ class RelatedField(Field):
def get_attribute(self, instance):
if self.use_pk_only_optimization() and self.source_attrs:
+ # Optimized case, return a mock object only containing the pk attribute.
try:
- # Optimized case, return a mock object only containing the pk attribute.
instance = get_attribute(instance, self.source_attrs[:-1])
return PKOnlyObject(pk=instance.serializable_value(self.source_attrs[-1]))
except AttributeError: