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'm sure I'm just doing something wrong but the documentation on working with polymorphic resources is pretty sparse so I'm not sure what to change. I have a polymorphic model Parent with two instance types and when I try to retrieve them using DRF's ModelViewSet I get this error: Exception: Cannot get fields from a polymorphic serializer given a queryset.
I have my resource_names defined on my models. I've tried passing a list instead of a queryset and that works for an empty response ([]) but I run into issue #400 for non-empty responses. What should I be passing to my serializer?
The text was updated successfully, but these errors were encountered:
I'm sure I'm just doing something wrong but the documentation on working with polymorphic resources is pretty sparse so I'm not sure what to change. I have a polymorphic model
Parent
with two instance types and when I try to retrieve them using DRF's ModelViewSet I get this error:Exception: Cannot get fields from a polymorphic serializer given a queryset
.Here are my views:
And here is my serializer:
I have my
resource_name
s defined on my models. I've tried passing a list instead of a queryset and that works for an empty response ([]
) but I run into issue #400 for non-empty responses. What should I be passing to my serializer?The text was updated successfully, but these errors were encountered: