自定义序列化程序中的字段

时间:2019-08-02 13:55:41

标签: python django api

我的代码:

class Meta: 
    fields = ('name')

为什么

ProjectsCreateSerializer

不起作用?我看到所有对象,不仅是名称。

我希望{"name": ""}中字段的输出为{"name": "","isActive": false},但实际输出为reset_index

0 个答案:

没有答案