class ArticleSerializer(serializers.ModelSerializer):
+ writer = serializers.IntegerField(write_only=True)
class Meta:
model = Article
$ curl http://localhost:8000/api/articles/3.json
{“id”:3,”title”:”hoge”,”contents”:”fuga”}
writer消失不见了。
class ArticleSerializer(serializers.ModelSerializer):
+ writer = serializers.IntegerField(write_only=True)
class Meta:
model = Article
$ curl http://localhost:8000/api/articles/3.json
{“id”:3,”title”:”hoge”,”contents”:”fuga”}
writer消失不见了。
让时间为你证明