示例#1
0
文件: views.py 项目: traceur/lbplayer
def ajax_childs(request):
    key = request.GET.get('key', '')
    nodes = gen_childs(lbp_settings.LBP_MEDIA_ROOT, key)
    if not key:#ROOT
        root_node = {"title": u"目录",
                "key": "__root__",
                "isFolder": True,
                "isLazy": True,
                "url": "",
                "children": nodes,
                }
        nodes = [root_node]
    return render_json_response(nodes)
示例#2
0
文件: views.py 项目: traceur/lbplayer
def ajax_medias(request):
    keys = request.POST.get("keys", "");
    keys = keys.split(',')
    medias = keys2medias(keys, lbp_settings.LBP_MEDIA_ROOT)
    return render_json_response(medias)