2020年10月17日

序列化类中定义自定义字段方法

摘要: 问题描述 Label模型类不存在users字段,但需要序列化返回users字段 解决方法 1、映射字段 users = serializers.SerializerMethodField() 疑问:没有这个步骤为什么也能新增字段。。。有这一行代码反而报错? 2、定义方法 ... 阅读全文

posted @ 2020-10-17 18:01 yycnblog 阅读(317) 评论(0) 推荐(0)

导航