说明:1. views.py
定义views视图函数,将数据存入字典。并用压缩为json格式,dumps,并return。
import json
def get_comments(request, article_id):
article_obj = models.Article.objects.get(id=article_id)
article_comments = article_obj.comment_set.select_related()
comment_dict = {}
f
<weixin_38640443> 上传 | 大小:33kb