1
The issue is there:
class ConversationSerializer(serializers.ModelSerializer):
msg_conv = MessagesSerializer()
By doing this, you are saying that Conversation
has a FK to Message
. Therefore DRF tries to do the mapping and fails because it’s the oposit.
You just need to add the many=True
argument to let DRF knows this is a reversed FK.
Source:stackexchange.com