Change to only BaseManager

This commit is contained in:
954 2022-10-25 07:58:26 +08:00
parent e52d4e8209
commit 61becb6bc6

View File

@ -681,9 +681,7 @@ class ListSerializer(BaseSerializer):
""" """
# Dealing with nested relationships, data can be a Manager, # Dealing with nested relationships, data can be a Manager,
# so, first get a queryset from the Manager if needed # so, first get a queryset from the Manager if needed
iterable = data.all() if isinstance(data, ( iterable = data.all() if isinstance(data, models.manager.BaseManager) else data
models.manager.Manager, models.manager.BaseManager
)) else data
return [ return [
self.child.to_representation(item) for item in iterable self.child.to_representation(item) for item in iterable