File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 13
13
from __future__ import unicode_literals
14
14
from django .db import models
15
15
from django .db .models .fields import FieldDoesNotExist , Field as DjangoModelField
16
+ from django .db .models import query
16
17
from django .utils .translation import ugettext_lazy as _
17
18
from rest_framework .compat import postgres_fields , unicode_to_repr
18
19
from rest_framework .utils import model_meta
@@ -562,7 +563,7 @@ def to_representation(self, data):
562
563
"""
563
564
# Dealing with nested relationships, data can be a Manager,
564
565
# so, first get a queryset from the Manager if needed
565
- iterable = data .all () if isinstance (data , models .Manager ) else data
566
+ iterable = data .all () if isinstance (data , ( models .Manager , query . QuerySet ) ) else data
566
567
return [
567
568
self .child .to_representation (item ) for item in iterable
568
569
]
You can’t perform that action at this time.
0 commit comments