-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Description
These days, I create a custom manager repr for django:
https://github.com/954-Ivory/django_bulk_hook_manager
But I get the error when I use it with DRF:
rest_framework/serializers.py", line 686, in to_representation
return [
TypeError: 'RelatedManager' object is not iterableSo, I check it, and found the reason.
iterable = data.all() if isinstance(data, models.Manager) else dataThis line should change to:
iterable = data.all() if isinstance(data, (
models.manager.Manager, models.manager.BaseManager
)) else dataWe need to check whether data is a BaseManager instance.
I will PR later.
HavingNoFuture