1👍
✅
Have a look at Nested Relationships in django rest framework.
If the field is used to represent a
to-many
relationship, you should add themany=True
flag to the serializer field.
What you have right now is this, which I think is not working and that’s why you have it commented.:
# gallery = GalleryListSerializer()
What you need is following:
gallery = GalleryListSerializer(many=True, read_only=True)
👤AKS
Source:stackexchange.com