From 4c015df28cfb7dc7cf29f6dc4985c57e1f5cdc5d Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 8 Oct 2014 16:43:33 +0100 Subject: Tweaks --- rest_framework/relations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rest_framework') diff --git a/rest_framework/relations.py b/rest_framework/relations.py index df5025b8..e9dd7dde 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -264,9 +264,10 @@ class ManyRelation(Field): ] def to_representation(self, obj): + iterable = obj.all() if (hasattr(obj, 'all')) else obj return [ self.child_relation.to_representation(value) - for value in obj.all() + for value in iterable ] @property -- cgit v1.2.3