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" )
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": "调用成功"}) )