django-rest-polymorphic
django-rest-polymorphic copied to clipboard
Serializing related object
I am attempting to serialize objects from a foreign key, before I made the fk a polymorphic model, this was working for my API
class PostSerializer(serializers.ModelSerializer):
pictures = PictureSerializer(read_only=True, many=True)
class Meta:
model = Post
fields = '__all__'
but using PicturePolymorphicSerializer
instead of PictureSerializer
isn't working, is there any way to add the polymorphic serializer as a rest api field?
@gradywoodruff Were you able to find a solution? Stuck on a similar problem.