Skip to content

Commit 7999472

Browse files
author
zmrenwu
committed
Step7: 在接口返回Markdown解析后的内容
1 parent 74a684c commit 7999472

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ $ git clone https://github.com/HelloGitHub-Team/HelloDjango-REST-framework-tutor
195195
6. [使用视图集简化代码](https://www.zmrenwu.com/courses/django-rest-framework-tutorial/materials/95/)
196196
7. [分页](https://www.zmrenwu.com/courses/django-rest-framework-tutorial/materials/96/)
197197
8. [文章详情 API](https://www.zmrenwu.com/courses/django-rest-framework-tutorial/materials/97/)
198+
9. [在接口返回Markdown解析后的内容](https://www.zmrenwu.com/courses/django-rest-framework-tutorial/materials/98/)
198199

199200
## 公众号
200201
<p align="center">

blog/serializers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class PostRetrieveSerializer(serializers.ModelSerializer):
5252
category = CategorySerializer()
5353
author = UserSerializer()
5454
tags = TagSerializer(many=True)
55+
toc = serializers.CharField()
56+
body_html = serializers.CharField()
5557

5658
class Meta:
5759
model = Post
@@ -66,4 +68,6 @@ class Meta:
6668
"category",
6769
"author",
6870
"tags",
71+
"toc",
72+
"body_html",
6973
]

0 commit comments

Comments
 (0)