1👍
You can implement this in the serializer. You can implement this is:
class AccountSerializer(serializers.ModelSerializer):
class Meta:
model = Account
fields = ['…']
and then we use that AccountSerializer
in the PostSerializer
:
class PostSerializer(serializers.ModelSerializer):
user_set = AccountSerializer(many=True)
class Meta:
model = Post
fields = ['…']
Source:stackexchange.com