You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to get the support for polymorphic model serialization to work in my latest project. When I request a specific object from my endpoint, the correct serializer is clearly instantiated and I receive the output that I would expect. When I try and retrieve a list of model instances, however, the following exception is raised:
Request Method: GET
Request URL: http://localhost:8000/projects
Django Version: 1.11
Exception Type: AttributeError
Exception Value: 'list' object has no attribute '_meta'
Exception Location: django-rest-framework-json-api/rest_framework_json_api/serializers.py in get_polymorphic_serializer_for_instance, line 279
I have tried running the example project, provided in the repo, and I'm able to reproduce the error I have been seeing.
Looking in the documentation, it is not clear whether there is currently support for serializing multiple model instances in a viewset list output. Looking at the tests for the project, I also do not see a test for this scenario.
Is this something that should be supported?
The text was updated successfully, but these errors were encountered:
I have been trying to get the support for polymorphic model serialization to work in my latest project. When I request a specific object from my endpoint, the correct serializer is clearly instantiated and I receive the output that I would expect. When I try and retrieve a list of model instances, however, the following exception is raised:
I have tried running the example project, provided in the repo, and I'm able to reproduce the error I have been seeing.
Looking in the documentation, it is not clear whether there is currently support for serializing multiple model instances in a viewset list output. Looking at the tests for the project, I also do not see a test for this scenario.
Is this something that should be supported?
The text was updated successfully, but these errors were encountered: