📜  在 django rest 框架中获取 id 的完整详细信息多对多 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:15.128000             🧑  作者: Mango

代码示例1
class PostSerializer(serializers.ModelSerializer):
    tag = TagSerializer(read_only=True, many=True)

    class Meta:
        model = Post
        fields = ('tag', 'text',)