예제 #1
0
파일: views.py 프로젝트: Quangor/ditui
def knowledges_earch(request):
    cateGoryId = int(request.POST.get("id"))
    knowledges = getKnowledge(cateGoryId)
    return HttpResponse(
        json.dumps({"status": "200", "knowledges": knowledges, "errMsg": "调用成功"}), content_type="application/json"
    )
예제 #2
0
파일: views.py 프로젝트: Quangor/ditui
def getKnowledgeById(request, cateGoryId, template_name="knowledge/titleList.html"):
    cateGoryId = int(cateGoryId)
    knowledges = getKnowledge(cateGoryId)
    return render_to_response(
        template_name, RequestContext(request, {"status": "200", "knowledges": knowledges, "errMsg": "调用成功"})
    )