aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulio Iván Alegre2014-12-09 16:13:18 +0100
committerJulio Iván Alegre2014-12-09 16:13:18 +0100
commit8d6b0b1f2d3a5014d43f1314d96bc9197709b542 (patch)
treea9737e8e1ab76d009d786aca253063b70e3bf413
parentf5b783af617f507efbc0d5ede0d27bd6be903d63 (diff)
downloaddjango-rest-framework-8d6b0b1f2d3a5014d43f1314d96bc9197709b542.tar.bz2
Update serializers.py
Treat the input queryset as it comes (maybe it has been changed in a higher level). Evaluating .all() does nothing if or if not is a queryset.
-rw-r--r--rest_framework/serializers.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index b0c0efa7..5c73c5f2 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -517,9 +517,8 @@ class ListSerializer(BaseSerializer):
"""
List of object instances -> List of dicts of primitive datatypes.
"""
- iterable = data.all() if (hasattr(data, 'all')) else data
return [
- self.child.to_representation(item) for item in iterable
+ self.child.to_representation(item) for item in data
]
def validate(self, attrs):