def list(req):
pageIndex=req.POST["pageIndex"] if req.POST["pageIndex"] else 0
pageNum=req.POST["pageNum"] if req.POST["pageNum"] else 20
articles=list(map(lambda x:x.__data,Article.objects[pageIndex*pageNum:(pageIndex+1)*pageNum]))
words=WordBag.objects(eid__in=list(map(lambda x:x["eid"],articles)))
for i in range(len(articles)):
articles[i]["keyWord"]=words[i].wordList
return JsonResponse({
"success":True,
"data":articles
})
评论列表
文章目录