I am working on a project in which I am using django-polymorphic for retrieving polymorphic result sets. I have some models which inherit from a parent model. For example, Model B inherits from Model A and Model C also inherits from Model A. Model B and Model C have their own serializers and when I query all records for model A, I get a mixed resultset containing instance of Model B and C.
How can I dynamically select serializer based on the instance?
Thanks