Skip to content

Commit

Permalink
Change to only BaseManager
Browse files Browse the repository at this point in the history
  • Loading branch information
954-Ivory committed Oct 24, 2022
1 parent e52d4e8 commit 61becb6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rest_framework/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,7 @@ def to_representation(self, data):
"""
# Dealing with nested relationships, data can be a Manager,
# so, first get a queryset from the Manager if needed
iterable = data.all() if isinstance(data, (
models.manager.Manager, models.manager.BaseManager
)) else data
iterable = data.all() if isinstance(data, models.manager.BaseManager) else data

return [
self.child.to_representation(item) for item in iterable
Expand Down

0 comments on commit 61becb6

Please sign in to comment.